Hi

On 2011.12.02 12:21, John Murray wrote:

Hi Mel

Tried to respond but had some problems with ximian because of ???

No. Could be our DNS.
I had to move servers physically (everybody is saving money over here)
and change IPs, so the best bet is that I messed something up.
We'll try to solve that.

Yes it would be useful to have a look at you windows .cs files

Attached.

Many thanks for your efforts

John Murray

No thanks to those Good Xamari[ta]n guys.

regards

mel

PS Just let me know if those are of any use...
We are currently pushing into MonoTouch, so these are filed under "open/nice-to-have Stuff"


--
Miljenko Cvjetko dipl.ing. ET
        Direktor/CEO
        Projektant rjes(enja/Solution Architect 
        Razvojni programer/Senior developer
        Voditelj projekta/Project Manager

IX juz(na obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvje...@holisticware.net
w: http://www.holisticware.net

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


using System.Diagnostics;
using System.Threading;

namespace TestsXWindowsFormsApplication1.MonoForAndroid
{
        public
                partial
                class 
                ConsoleProcess
        {
                private delegate void ReceiveCallback(System.IO.StreamReader 
reader, string text);

                private void IoReader(object stateInfo)
                {
                        System.IO.StreamReader reader = stateInfo as 
System.IO.StreamReader;
                        string s;

                        while ((s = reader.ReadLine()) != null)
                        {
                                
Debug.WriteLine(Thread.CurrentThread.GetHashCode().ToString() + ": IoReader: " 
+ s);
                                
                                // execute the delegate on the thread that owns 
the form
                                // mc++????
                                //this.Invoke(new ReceiveCallback(OnReceive), 
new object[] { reader, s });
                                //OnReceive(reader, s);
                        }
                }


                private void OnReceive(System.IO.StreamReader reader, string 
text)
                {
                        
Debug.WriteLine(Thread.CurrentThread.GetHashCode().ToString() + ": OnReceive: " 
+ text);

                        if (reader == this._Process.StandardOutput)
                                StdOut += text + "\r\n";
                        else if (reader == this._Process.StandardError)
                                StdErr += text + "\r\n";
                }
        }
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TestsXWindowsFormsApplication1.MonoForAndroid
{
        public 
                partial 
                class 
                UserControlMonoForAndroidVisualStudioStartup 
                :
                UserControl
        {
                string[] CommandsADB = null;

                private ConsoleProcess console_process_emulator;
                private ConsoleProcess console_process_adb;
                private ConsoleProcess console_process_sdkmanager;

                public UserControlMonoForAndroidVisualStudioStartup()
                {
                        InitializeComponent();

                        string[] separators = new string[] { ";" };
                        CommandsADB = Properties.Settings.Default
                                        .CommandsADB.Split(separators, 
StringSplitOptions.None);

                        textBoxPathToAndroidSDK.Text = 
Properties.Settings.Default.PathAndroidSDK;
                        textBoxPathToADB.Text = 
Properties.Settings.Default.PathADB;
                        textBoxPathEmulator.Text = 
Properties.Settings.Default.PathEmulator;
                        textBoxEmulatorOptions.Text = 
Properties.Settings.Default.EmulatorOptions;

                        checkedListBox1.Items.AddRange(CommandsADB);

                        console_process_emulator = new ConsoleProcess();
                        console_process_emulator.TargetTextBox = 
this.textBoxConsoleEmulator;
                        console_process_adb = new ConsoleProcess();
                        console_process_adb.TargetTextBox = 
this.textBoxConsoleADB;
                        console_process_sdkmanager = new ConsoleProcess();
                        console_process_sdkmanager.TargetTextBox = 
this.textBoxConsoleSDKManger;


                        return;
                }


                private void buttonADBServiceStop_Click(object sender, 
EventArgs e)
                {
                        textBoxADBCommand.Text = "kill-server";

                        return;
                }

                private void buttonADBServiceStart_Click(object sender, 
EventArgs e)
                {
                        textBoxADBCommand.Text = "start-server";

                        return;
                }

                private void buttonADBServiceRestart_Click(object sender, 
EventArgs e)
                {
                        textBoxADBCommand.Text = "kill-server; start-server";

                        return;
                }

                private void buttonCommandsADBExecute_Click(object sender, 
EventArgs e)
                {
                        StringBuilder output_batch = new StringBuilder();

                        foreach (string c in checkedListBox1.CheckedItems)
                        {
                                console_process_adb.Start
                                                                                
(
                                                                                
  textBoxPathToADB.Text
                                                                                
, c
                                                                                
);
                        }

                        return;
                }

                private void buttonEmulatorStart_Click(object sender, EventArgs 
e)
                {
                        console_process_emulator.Start
                                                                                
( 
                                                                                
  textBoxPathEmulator.Text
                                                                                
, textBoxEmulatorOptions.Text
                                                                                
);

                        return;
                }

                private void buttonADBCommandExecute_Click(object sender, 
EventArgs e)
                {
                        console_process_adb.Start
                                                                        (
                                                                          
textBoxPathToADB.Text
                                                                        , 
textBoxADBCommand.Text
                                                                        );

                        return;
                }

                private void linkLabelDocumentation_LinkClicked(object sender, 
LinkLabelLinkClickedEventArgs e)
                {
                        LinkLabel l = sender as LinkLabel;
                        System.Diagnostics.Process.Start(l.Text);

                        return;
                }



                private void buttonClear_Click(object sender, EventArgs e)
                {
                        textBoxConsoleADB.Text = "";

                        return;
                }


        }
}
namespace TestsXWindowsFormsApplication1.MonoForAndroid
{
        partial class UserControlMonoForAndroidVisualStudioStartup
        {
                /// <summary> 
                /// Required designer variable.
                /// </summary>
                private System.ComponentModel.IContainer components = null;

                /// <summary> 
                /// Clean up any resources being used.
                /// </summary>
                /// <param name="disposing">true if managed resources should be 
disposed; otherwise, false.</param>
                protected override void Dispose(bool disposing)
                {
                        if (disposing && (components != null))
                        {
                                components.Dispose();
                        }
                        base.Dispose(disposing);
                }

                #region Component Designer generated code

                /// <summary> 
                /// Required method for Designer support - do not modify 
                /// the contents of this method with the code editor.
                /// </summary>
                private void InitializeComponent()
                {
                        this.laelStartupUtilities = new 
System.Windows.Forms.Label();
                        this.textBoxConsoleADB = new 
System.Windows.Forms.TextBox();
                        this.checkedListBox1 = new 
System.Windows.Forms.CheckedListBox();
                        this.buttonCommandsADBExecute = new 
System.Windows.Forms.Button();
                        this.tabControlMonoForAndroid = new 
System.Windows.Forms.TabControl();
                        this.tabPageEmulator = new 
System.Windows.Forms.TabPage();
                        this.linkLabelDocumentationEmulator = new 
System.Windows.Forms.LinkLabel();
                        this.labelEmulatorOptions = new 
System.Windows.Forms.Label();
                        this.buttonEmulatorStart = new 
System.Windows.Forms.Button();
                        this.textBoxEmulatorOptions = new 
System.Windows.Forms.TextBox();
                        this.textBoxPathEmulator = new 
System.Windows.Forms.TextBox();
                        this.labelPathEmulator = new 
System.Windows.Forms.Label();
                        this.tabPageADB = new System.Windows.Forms.TabPage();
                        this.buttonClear = new System.Windows.Forms.Button();
                        this.linkLabelDocumentationADB = new 
System.Windows.Forms.LinkLabel();
                        this.buttonADBCommandExecute = new 
System.Windows.Forms.Button();
                        this.labelADBCommand = new System.Windows.Forms.Label();
                        this.textBoxADBCommand = new 
System.Windows.Forms.TextBox();
                        this.textBoxPathToADB = new 
System.Windows.Forms.TextBox();
                        this.labelPathToADB = new System.Windows.Forms.Label();
                        this.buttonADBServiceRestart = new 
System.Windows.Forms.Button();
                        this.buttonADBServiceStart = new 
System.Windows.Forms.Button();
                        this.buttonADBServiceStop = new 
System.Windows.Forms.Button();
                        this.tabPageAndroidSDKManager = new 
System.Windows.Forms.TabPage();
                        this.button1 = new System.Windows.Forms.Button();
                        this.textBox1 = new System.Windows.Forms.TextBox();
                        this.label1 = new System.Windows.Forms.Label();
                        this.textBoxPathToAndroidSDK = new 
System.Windows.Forms.TextBox();
                        this.labelPathToAndroidSDK = new 
System.Windows.Forms.Label();
                        this.textBoxConsoleEmulator = new 
System.Windows.Forms.TextBox();
                        this.textBoxConsoleSDKManger = new 
System.Windows.Forms.TextBox();
                        this.tabControlMonoForAndroid.SuspendLayout();
                        this.tabPageEmulator.SuspendLayout();
                        this.tabPageADB.SuspendLayout();
                        this.tabPageAndroidSDKManager.SuspendLayout();
                        this.SuspendLayout();
                        // 
                        // laelStartupUtilities
                        // 
                        this.laelStartupUtilities.AutoSize = true;
                        this.laelStartupUtilities.Location = new 
System.Drawing.Point(18, 0);
                        this.laelStartupUtilities.Name = "laelStartupUtilities";
                        this.laelStartupUtilities.Size = new 
System.Drawing.Size(74, 13);
                        this.laelStartupUtilities.TabIndex = 1;
                        this.laelStartupUtilities.Text = "StartupUtilities";
                        // 
                        // textBoxConsoleADB
                        // 
                        this.textBoxConsoleADB.Location = new 
System.Drawing.Point(120, 75);
                        this.textBoxConsoleADB.Multiline = true;
                        this.textBoxConsoleADB.Name = "textBoxConsoleADB";
                        this.textBoxConsoleADB.Size = new 
System.Drawing.Size(686, 372);
                        this.textBoxConsoleADB.TabIndex = 12;
                        // 
                        // checkedListBox1
                        // 
                        this.checkedListBox1.FormattingEnabled = true;
                        this.checkedListBox1.Location = new 
System.Drawing.Point(812, 312);
                        this.checkedListBox1.Name = "checkedListBox1";
                        this.checkedListBox1.Size = new System.Drawing.Size(94, 
109);
                        this.checkedListBox1.TabIndex = 15;
                        // 
                        // buttonCommandsADBExecute
                        // 
                        this.buttonCommandsADBExecute.Location = new 
System.Drawing.Point(812, 424);
                        this.buttonCommandsADBExecute.Name = 
"buttonCommandsADBExecute";
                        this.buttonCommandsADBExecute.Size = new 
System.Drawing.Size(94, 23);
                        this.buttonCommandsADBExecute.TabIndex = 16;
                        this.buttonCommandsADBExecute.Text = "Execute";
                        this.buttonCommandsADBExecute.UseVisualStyleBackColor = 
true;
                        this.buttonCommandsADBExecute.Click += new 
System.EventHandler(this.buttonCommandsADBExecute_Click);
                        // 
                        // tabControlMonoForAndroid
                        // 
                        
this.tabControlMonoForAndroid.Controls.Add(this.tabPageEmulator);
                        
this.tabControlMonoForAndroid.Controls.Add(this.tabPageADB);
                        
this.tabControlMonoForAndroid.Controls.Add(this.tabPageAndroidSDKManager);
                        this.tabControlMonoForAndroid.Location = new 
System.Drawing.Point(21, 16);
                        this.tabControlMonoForAndroid.Name = 
"tabControlMonoForAndroid";
                        this.tabControlMonoForAndroid.SelectedIndex = 0;
                        this.tabControlMonoForAndroid.Size = new 
System.Drawing.Size(920, 497);
                        this.tabControlMonoForAndroid.TabIndex = 17;
                        // 
                        // tabPageEmulator
                        // 
                        
this.tabPageEmulator.Controls.Add(this.textBoxConsoleEmulator);
                        
this.tabPageEmulator.Controls.Add(this.linkLabelDocumentationEmulator);
                        
this.tabPageEmulator.Controls.Add(this.labelEmulatorOptions);
                        
this.tabPageEmulator.Controls.Add(this.buttonEmulatorStart);
                        
this.tabPageEmulator.Controls.Add(this.textBoxEmulatorOptions);
                        
this.tabPageEmulator.Controls.Add(this.textBoxPathEmulator);
                        
this.tabPageEmulator.Controls.Add(this.labelPathEmulator);
                        this.tabPageEmulator.Location = new 
System.Drawing.Point(4, 22);
                        this.tabPageEmulator.Name = "tabPageEmulator";
                        this.tabPageEmulator.Size = new 
System.Drawing.Size(912, 471);
                        this.tabPageEmulator.TabIndex = 2;
                        this.tabPageEmulator.Text = "Android Emulator";
                        this.tabPageEmulator.UseVisualStyleBackColor = true;
                        // 
                        // linkLabelDocumentationEmulator
                        // 
                        this.linkLabelDocumentationEmulator.AutoSize = true;
                        this.linkLabelDocumentationEmulator.Location = new 
System.Drawing.Point(512, 12);
                        this.linkLabelDocumentationEmulator.Name = 
"linkLabelDocumentationEmulator";
                        this.linkLabelDocumentationEmulator.Size = new 
System.Drawing.Size(328, 13);
                        this.linkLabelDocumentationEmulator.TabIndex = 17;
                        this.linkLabelDocumentationEmulator.TabStop = true;
                        this.linkLabelDocumentationEmulator.Text = 
"http://developer.android.com/guide/developing/tools/emulator.html";;
                        this.linkLabelDocumentationEmulator.LinkClicked += new 
System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelDocumentation_LinkClicked);
                        // 
                        // labelEmulatorOptions
                        // 
                        this.labelEmulatorOptions.AutoSize = true;
                        this.labelEmulatorOptions.Location = new 
System.Drawing.Point(3, 38);
                        this.labelEmulatorOptions.Name = "labelEmulatorOptions";
                        this.labelEmulatorOptions.Size = new 
System.Drawing.Size(90, 13);
                        this.labelEmulatorOptions.TabIndex = 16;
                        this.labelEmulatorOptions.Text = "Emulator Options:";
                        // 
                        // buttonEmulatorStart
                        // 
                        this.buttonEmulatorStart.Location = new 
System.Drawing.Point(515, 33);
                        this.buttonEmulatorStart.Name = "buttonEmulatorStart";
                        this.buttonEmulatorStart.Size = new 
System.Drawing.Size(122, 23);
                        this.buttonEmulatorStart.TabIndex = 15;
                        this.buttonEmulatorStart.Text = "Emulator Start";
                        this.buttonEmulatorStart.UseVisualStyleBackColor = true;
                        this.buttonEmulatorStart.Click += new 
System.EventHandler(this.buttonEmulatorStart_Click);
                        // 
                        // textBoxEmulatorOptions
                        // 
                        this.textBoxEmulatorOptions.Location = new 
System.Drawing.Point(117, 35);
                        this.textBoxEmulatorOptions.Name = 
"textBoxEmulatorOptions";
                        this.textBoxEmulatorOptions.Size = new 
System.Drawing.Size(378, 20);
                        this.textBoxEmulatorOptions.TabIndex = 14;
                        // 
                        // textBoxPathEmulator
                        // 
                        this.textBoxPathEmulator.Location = new 
System.Drawing.Point(117, 9);
                        this.textBoxPathEmulator.Name = "textBoxPathEmulator";
                        this.textBoxPathEmulator.Size = new 
System.Drawing.Size(378, 20);
                        this.textBoxPathEmulator.TabIndex = 13;
                        // 
                        // labelPathEmulator
                        // 
                        this.labelPathEmulator.AutoSize = true;
                        this.labelPathEmulator.Location = new 
System.Drawing.Point(3, 12);
                        this.labelPathEmulator.Name = "labelPathEmulator";
                        this.labelPathEmulator.Size = new 
System.Drawing.Size(88, 13);
                        this.labelPathEmulator.TabIndex = 12;
                        this.labelPathEmulator.Text = "Path to Emulator:";
                        // 
                        // tabPageADB
                        // 
                        this.tabPageADB.Controls.Add(this.buttonClear);
                        
this.tabPageADB.Controls.Add(this.linkLabelDocumentationADB);
                        
this.tabPageADB.Controls.Add(this.buttonADBCommandExecute);
                        this.tabPageADB.Controls.Add(this.labelADBCommand);
                        this.tabPageADB.Controls.Add(this.textBoxADBCommand);
                        this.tabPageADB.Controls.Add(this.textBoxPathToADB);
                        
this.tabPageADB.Controls.Add(this.buttonCommandsADBExecute);
                        this.tabPageADB.Controls.Add(this.labelPathToADB);
                        this.tabPageADB.Controls.Add(this.textBoxConsoleADB);
                        this.tabPageADB.Controls.Add(this.checkedListBox1);
                        
this.tabPageADB.Controls.Add(this.buttonADBServiceRestart);
                        
this.tabPageADB.Controls.Add(this.buttonADBServiceStart);
                        this.tabPageADB.Controls.Add(this.buttonADBServiceStop);
                        this.tabPageADB.Location = new System.Drawing.Point(4, 
22);
                        this.tabPageADB.Name = "tabPageADB";
                        this.tabPageADB.Padding = new 
System.Windows.Forms.Padding(3);
                        this.tabPageADB.Size = new System.Drawing.Size(912, 
471);
                        this.tabPageADB.TabIndex = 1;
                        this.tabPageADB.Text = "ADB (Android Debug Bridge)";
                        this.tabPageADB.UseVisualStyleBackColor = true;
                        // 
                        // buttonClear
                        // 
                        this.buttonClear.Location = new 
System.Drawing.Point(599, 34);
                        this.buttonClear.Name = "buttonClear";
                        this.buttonClear.Size = new System.Drawing.Size(79, 23);
                        this.buttonClear.TabIndex = 24;
                        this.buttonClear.Text = "Clear";
                        this.buttonClear.UseVisualStyleBackColor = true;
                        this.buttonClear.Click += new 
System.EventHandler(this.buttonClear_Click);
                        // 
                        // linkLabelDocumentationADB
                        // 
                        this.linkLabelDocumentationADB.AutoSize = true;
                        this.linkLabelDocumentationADB.Location = new 
System.Drawing.Point(511, 13);
                        this.linkLabelDocumentationADB.Name = 
"linkLabelDocumentationADB";
                        this.linkLabelDocumentationADB.Size = new 
System.Drawing.Size(306, 13);
                        this.linkLabelDocumentationADB.TabIndex = 23;
                        this.linkLabelDocumentationADB.TabStop = true;
                        this.linkLabelDocumentationADB.Text = 
"http://developer.android.com/guide/developing/tools/adb.html";;
                        this.linkLabelDocumentationADB.LinkClicked += new 
System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelDocumentation_LinkClicked);
                        // 
                        // buttonADBCommandExecute
                        // 
                        this.buttonADBCommandExecute.Location = new 
System.Drawing.Point(514, 34);
                        this.buttonADBCommandExecute.Name = 
"buttonADBCommandExecute";
                        this.buttonADBCommandExecute.Size = new 
System.Drawing.Size(79, 23);
                        this.buttonADBCommandExecute.TabIndex = 22;
                        this.buttonADBCommandExecute.Text = "Execute";
                        this.buttonADBCommandExecute.UseVisualStyleBackColor = 
true;
                        this.buttonADBCommandExecute.Click += new 
System.EventHandler(this.buttonADBCommandExecute_Click);
                        // 
                        // labelADBCommand
                        // 
                        this.labelADBCommand.AutoSize = true;
                        this.labelADBCommand.Location = new 
System.Drawing.Point(6, 39);
                        this.labelADBCommand.Name = "labelADBCommand";
                        this.labelADBCommand.Size = new System.Drawing.Size(82, 
13);
                        this.labelADBCommand.TabIndex = 21;
                        this.labelADBCommand.Text = "ADB Command:";
                        // 
                        // textBoxADBCommand
                        // 
                        this.textBoxADBCommand.Location = new 
System.Drawing.Point(120, 36);
                        this.textBoxADBCommand.Name = "textBoxADBCommand";
                        this.textBoxADBCommand.Size = new 
System.Drawing.Size(378, 20);
                        this.textBoxADBCommand.TabIndex = 20;
                        // 
                        // textBoxPathToADB
                        // 
                        this.textBoxPathToADB.Location = new 
System.Drawing.Point(120, 10);
                        this.textBoxPathToADB.Name = "textBoxPathToADB";
                        this.textBoxPathToADB.Size = new 
System.Drawing.Size(378, 20);
                        this.textBoxPathToADB.TabIndex = 19;
                        // 
                        // labelPathToADB
                        // 
                        this.labelPathToADB.AutoSize = true;
                        this.labelPathToADB.Location = new 
System.Drawing.Point(6, 13);
                        this.labelPathToADB.Name = "labelPathToADB";
                        this.labelPathToADB.Size = new System.Drawing.Size(69, 
13);
                        this.labelPathToADB.TabIndex = 18;
                        this.labelPathToADB.Text = "Path to ADB:";
                        // 
                        // buttonADBServiceRestart
                        // 
                        this.buttonADBServiceRestart.Location = new 
System.Drawing.Point(812, 133);
                        this.buttonADBServiceRestart.Name = 
"buttonADBServiceRestart";
                        this.buttonADBServiceRestart.Size = new 
System.Drawing.Size(94, 23);
                        this.buttonADBServiceRestart.TabIndex = 17;
                        this.buttonADBServiceRestart.Text = "Server Restart";
                        this.buttonADBServiceRestart.UseVisualStyleBackColor = 
true;
                        this.buttonADBServiceRestart.Click += new 
System.EventHandler(this.buttonADBServiceRestart_Click);
                        // 
                        // buttonADBServiceStart
                        // 
                        this.buttonADBServiceStart.Location = new 
System.Drawing.Point(812, 104);
                        this.buttonADBServiceStart.Name = 
"buttonADBServiceStart";
                        this.buttonADBServiceStart.Size = new 
System.Drawing.Size(94, 23);
                        this.buttonADBServiceStart.TabIndex = 16;
                        this.buttonADBServiceStart.Text = "Server Start";
                        this.buttonADBServiceStart.UseVisualStyleBackColor = 
true;
                        this.buttonADBServiceStart.Click += new 
System.EventHandler(this.buttonADBServiceStart_Click);
                        // 
                        // buttonADBServiceStop
                        // 
                        this.buttonADBServiceStop.Location = new 
System.Drawing.Point(812, 75);
                        this.buttonADBServiceStop.Name = "buttonADBServiceStop";
                        this.buttonADBServiceStop.Size = new 
System.Drawing.Size(94, 23);
                        this.buttonADBServiceStop.TabIndex = 15;
                        this.buttonADBServiceStop.Text = "Server Stop";
                        this.buttonADBServiceStop.UseVisualStyleBackColor = 
true;
                        this.buttonADBServiceStop.Click += new 
System.EventHandler(this.buttonADBServiceStop_Click);
                        // 
                        // tabPageAndroidSDKManager
                        // 
                        
this.tabPageAndroidSDKManager.Controls.Add(this.textBoxConsoleSDKManger);
                        
this.tabPageAndroidSDKManager.Controls.Add(this.button1);
                        
this.tabPageAndroidSDKManager.Controls.Add(this.textBox1);
                        this.tabPageAndroidSDKManager.Controls.Add(this.label1);
                        
this.tabPageAndroidSDKManager.Controls.Add(this.textBoxPathToAndroidSDK);
                        
this.tabPageAndroidSDKManager.Controls.Add(this.labelPathToAndroidSDK);
                        this.tabPageAndroidSDKManager.Location = new 
System.Drawing.Point(4, 22);
                        this.tabPageAndroidSDKManager.Name = 
"tabPageAndroidSDKManager";
                        this.tabPageAndroidSDKManager.Padding = new 
System.Windows.Forms.Padding(3);
                        this.tabPageAndroidSDKManager.Size = new 
System.Drawing.Size(912, 471);
                        this.tabPageAndroidSDKManager.TabIndex = 0;
                        this.tabPageAndroidSDKManager.Text = "Android SDK 
Manager";
                        this.tabPageAndroidSDKManager.UseVisualStyleBackColor = 
true;
                        // 
                        // button1
                        // 
                        this.button1.Location = new System.Drawing.Point(520, 
37);
                        this.button1.Name = "button1";
                        this.button1.Size = new System.Drawing.Size(122, 23);
                        this.button1.TabIndex = 16;
                        this.button1.Text = "SDK Manager Start";
                        this.button1.UseVisualStyleBackColor = true;
                        // 
                        // textBox1
                        // 
                        this.textBox1.Location = new System.Drawing.Point(120, 
40);
                        this.textBox1.Name = "textBox1";
                        this.textBox1.Size = new System.Drawing.Size(378, 20);
                        this.textBox1.TabIndex = 7;
                        // 
                        // label1
                        // 
                        this.label1.AutoSize = true;
                        this.label1.Location = new System.Drawing.Point(6, 43);
                        this.label1.Name = "label1";
                        this.label1.Size = new System.Drawing.Size(108, 13);
                        this.label1.TabIndex = 6;
                        this.label1.Text = "Path to Android SDK:";
                        // 
                        // textBoxPathToAndroidSDK
                        // 
                        this.textBoxPathToAndroidSDK.Location = new 
System.Drawing.Point(120, 12);
                        this.textBoxPathToAndroidSDK.Name = 
"textBoxPathToAndroidSDK";
                        this.textBoxPathToAndroidSDK.Size = new 
System.Drawing.Size(378, 20);
                        this.textBoxPathToAndroidSDK.TabIndex = 5;
                        // 
                        // labelPathToAndroidSDK
                        // 
                        this.labelPathToAndroidSDK.AutoSize = true;
                        this.labelPathToAndroidSDK.Location = new 
System.Drawing.Point(6, 15);
                        this.labelPathToAndroidSDK.Name = 
"labelPathToAndroidSDK";
                        this.labelPathToAndroidSDK.Size = new 
System.Drawing.Size(108, 13);
                        this.labelPathToAndroidSDK.TabIndex = 4;
                        this.labelPathToAndroidSDK.Text = "Path to Android 
SDK:";
                        // 
                        // textBoxConsoleEmulator
                        // 
                        this.textBoxConsoleEmulator.Location = new 
System.Drawing.Point(117, 62);
                        this.textBoxConsoleEmulator.Multiline = true;
                        this.textBoxConsoleEmulator.Name = 
"textBoxConsoleEmulator";
                        this.textBoxConsoleEmulator.Size = new 
System.Drawing.Size(686, 372);
                        this.textBoxConsoleEmulator.TabIndex = 18;
                        // 
                        // textBoxConsoleSDKManger
                        // 
                        this.textBoxConsoleSDKManger.Location = new 
System.Drawing.Point(120, 66);
                        this.textBoxConsoleSDKManger.Multiline = true;
                        this.textBoxConsoleSDKManger.Name = 
"textBoxConsoleSDKManger";
                        this.textBoxConsoleSDKManger.Size = new 
System.Drawing.Size(686, 372);
                        this.textBoxConsoleSDKManger.TabIndex = 19;
                        // 
                        // UserControlMonoForAndroidVisualStudioStartup
                        // 
                        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 
13F);
                        this.AutoScaleMode = 
System.Windows.Forms.AutoScaleMode.Font;
                        this.Controls.Add(this.tabControlMonoForAndroid);
                        this.Controls.Add(this.laelStartupUtilities);
                        this.Name = 
"UserControlMonoForAndroidVisualStudioStartup";
                        this.Size = new System.Drawing.Size(944, 516);
                        this.tabControlMonoForAndroid.ResumeLayout(false);
                        this.tabPageEmulator.ResumeLayout(false);
                        this.tabPageEmulator.PerformLayout();
                        this.tabPageADB.ResumeLayout(false);
                        this.tabPageADB.PerformLayout();
                        this.tabPageAndroidSDKManager.ResumeLayout(false);
                        this.tabPageAndroidSDKManager.PerformLayout();
                        this.ResumeLayout(false);
                        this.PerformLayout();

                }

                #endregion

                private System.Windows.Forms.Label laelStartupUtilities;
                private System.Windows.Forms.TextBox textBoxConsoleADB;
                private System.Windows.Forms.CheckedListBox checkedListBox1;
                private System.Windows.Forms.Button buttonCommandsADBExecute;
                private System.Windows.Forms.TabControl 
tabControlMonoForAndroid;
                private System.Windows.Forms.TabPage tabPageAndroidSDKManager;
                private System.Windows.Forms.TextBox textBox1;
                private System.Windows.Forms.Label label1;
                private System.Windows.Forms.TextBox textBoxPathToAndroidSDK;
                private System.Windows.Forms.Label labelPathToAndroidSDK;
                private System.Windows.Forms.TabPage tabPageADB;
                private System.Windows.Forms.TextBox textBoxPathToADB;
                private System.Windows.Forms.Label labelPathToADB;
                private System.Windows.Forms.Button buttonADBServiceRestart;
                private System.Windows.Forms.Button buttonADBServiceStart;
                private System.Windows.Forms.Button buttonADBServiceStop;
                private System.Windows.Forms.TabPage tabPageEmulator;
                private System.Windows.Forms.LinkLabel 
linkLabelDocumentationEmulator;
                private System.Windows.Forms.Label labelEmulatorOptions;
                private System.Windows.Forms.Button buttonEmulatorStart;
                private System.Windows.Forms.TextBox textBoxEmulatorOptions;
                private System.Windows.Forms.TextBox textBoxPathEmulator;
                private System.Windows.Forms.Label labelPathEmulator;
                private System.Windows.Forms.Button buttonADBCommandExecute;
                private System.Windows.Forms.Label labelADBCommand;
                private System.Windows.Forms.TextBox textBoxADBCommand;
                private System.Windows.Forms.Button button1;
                private System.Windows.Forms.LinkLabel 
linkLabelDocumentationADB;
                private System.Windows.Forms.Button buttonClear;
                private System.Windows.Forms.TextBox textBoxConsoleEmulator;
                private System.Windows.Forms.TextBox textBoxConsoleSDKManger;
        }
}
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, 
System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, 
System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a 
comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" 
mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" 
mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of 
the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"; />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" 
msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" 
msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" 
msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" 
msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" 
msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
</root>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Diagnostics;
using System.Windows.Forms;
using System.Threading;

namespace TestsXWindowsFormsApplication1.MonoForAndroid
{
        // 
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23882194.html
        // 
http://www.eggheadcafe.com/community/aspnet/2/11431/need-to-read-from-stdout-and-stderr-in-a-proces.aspx
        public
                partial
                class 
                ConsoleProcess
        {

                # region ---- Property Process Process --------------------
                private Process _Process;

                public Process Process
                {
                        get { return _Process; }
                        set
                        {
                                if (value != _Process)
                                {
                                        // lock(_Process) // MultiThread safe
                                        {
                                                _Process = value;
                                                if (null != ProcessChanged)
                                                        ProcessChanged(this, 
new EventArgs());
                                        }
                                }
                        }
                }

                public event EventHandler ProcessChanged;
                # endregion ---- Process Property.Process --------------------

                # region ---- Property ProcessStartInfo ProcessStartInfo 
--------------------
                private ProcessStartInfo _ProcessStartInfo;

                public ProcessStartInfo ProcessStartInfo
                {
                        get { return _ProcessStartInfo; }
                        set
                        {
                                if (value != _ProcessStartInfo)
                                {
                                        // lock(_ProcessStartInfo) // 
MultiThread safe
                                        {
                                                _ProcessStartInfo = value;
                                                if (null != 
ProcessStartInfoChanged)
                                                        
ProcessStartInfoChanged(this, new EventArgs());
                                        }
                                }
                        }
                }

                public event EventHandler ProcessStartInfoChanged;
                # endregion ---- ProcessStartInfo Property.ProcessStartInfo 
--------------------

                # region ---- Property string ConsoleText --------------------
                private string _ConsoleText;

                public string ConsoleText
                {
                        get { return _ConsoleText; }
                        set
                        {
                                if (value != _ConsoleText)
                                {
                                        // lock(_ConsoleText) // MultiThread 
safe
                                        {
                                                _ConsoleText = value;
                                                if (null != ConsoleTextChanged)
                                                        
ConsoleTextChanged(this, new EventArgs());
                                        }
                                }
                        }
                }

                public event EventHandler ConsoleTextChanged;
                # endregion ---- string Property.ConsoleText 
--------------------

                # region ---- Property TextBox TargetTextBox 
--------------------
                private TextBox _TargetTextBox;

                public TextBox TargetTextBox
                {
                        get { return _TargetTextBox; }
                        set
                        {
                                if (value != _TargetTextBox)
                                {
                                        // lock(_TargetTextBox) // MultiThread 
safe
                                        {
                                                _TargetTextBox = value;
                                                if (null != 
TargetTextBoxChanged)
                                                        
TargetTextBoxChanged(this, new EventArgs());
                                        }
                                }
                        }
                }

                public event EventHandler TargetTextBoxChanged;
                # endregion ---- TextBox Property.TargetTextBox 
--------------------

                public string StdOut;
                public string StdErr;

                public
                        void
                        Start
                        (
                          string application
                        , string options
                        )
                {
                        String output = string.Empty;
                        String error = string.Empty;

                        
                        _Process = new System.Diagnostics.Process();
                        _Process.StartInfo.FileName = application;
                        _Process.StartInfo.Arguments = options;

                        _Process.StartInfo.RedirectStandardOutput = true;
                        _Process.StartInfo.RedirectStandardError = true;
                        _Process.StartInfo.RedirectStandardInput = true;
                        _Process.StartInfo.UseShellExecute = false;
                        _Process.StartInfo.CreateNoWindow = true;

                        _Process.OutputDataReceived += new 
System.Diagnostics.DataReceivedEventHandler(ConsoleOutputHandler);
                        _Process.ErrorDataReceived += new 
System.Diagnostics.DataReceivedEventHandler(ConsoleOutputHandler);

                        _Process.Start();

                        // async reading!

                        // Reading01
                        _Process.BeginOutputReadLine();
                        _Process.BeginErrorReadLine();

                        // Reading02
                        //ThreadPool.QueueUserWorkItem(new 
WaitCallback(IoReader), _Process.StandardOutput);
                        //ThreadPool.QueueUserWorkItem(new 
WaitCallback(IoReader), _Process.StandardError);

                        return;
                }





        
        }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;

using System.Windows.Forms;

namespace TestsXWindowsFormsApplication1.MonoForAndroid
{
        public
                partial
                class 
                ConsoleProcess
        {
                private
                        void
                        ConsoleOutputHandler
                        (
                          object sending_Process
                        , System.Diagnostics.DataReceivedEventArgs received
                        )
                {
                        if (null == received)
                        {
                                return;
                        }
                        string received_text = received.Data;
                        try
                        {
                                if (!String.IsNullOrEmpty(received_text))
                                {
                                        string line = received_text + "\n";
                                        UpdateConsoleText(line);
                                }
                        }
                        catch (System.Exception x)
                        {
                                StringBuilder sb_msg = new StringBuilder();
                                sb_msg.Append("");
                                throw new System.Exception(sb_msg.ToString());
                        }
                        finally
                        {
                        }

                        return;
                }

                private
                        delegate
                        void
                        UpdateConsoleTargetControlDelegate(string message);


                private void UpdateConsoleText(string message)
                {
                        if (TargetTextBox.InvokeRequired)
                        {
                                UpdateConsoleTargetControlDelegate update;
                                update = new 
UpdateConsoleTargetControlDelegate(UpdateConsoleText);

                                //target.Invoke(update, message);
                                //target.BeginInvoke(update, message);

                                TargetTextBox.BeginInvoke(update, new object[] 
{ message });
                                //target.Invoke(update, new object[] { message 
});
                        }
                        else
                        {
                                TargetTextBox.AppendText(message);
                        }

                        return;
                }

        }
}
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to