private void buildGui()
        {
            this.invokeOnThread(
                () =>
            {
                "Buliding Gui for ascx_ExecuteScripts.cs.o2".info();
                // add controls
                statusLabel              = this.parentForm().add_StatusStrip(Color.White);
                BackColor                = Color.White;
                var topPanel             = this.add_Panel();
                var pictureBox           = topPanel.add_PictureBox();
                statusLabel.IsLink       = true;
                statusLabel.LinkBehavior = LinkBehavior.NeverUnderline;
                statusLabel.set_Text(welcomeMessage).textColor(this, Color.Black);

                results_RichTextBox = this.add_RichTextBox();

                mainSplitContainer = topPanel.insert_Below(results_RichTextBox, 100)
                                     .get <SplitContainer>();

                mainSplitContainer.panel2Collapsed(true);

                setupPictureBoxContextMenu(pictureBox);

                pictureBox.load(FormImages.O2_Logo);
                this.onDrop((file) => loadFile(file));

                statusLabel.Click += (sender, e) => openSimpleScriptEditor();
                //statusLabel.textColor(this, Color.Black);

                // put this on menu item
                //this.add_Link("reload",10,2,()=>loadH2Script());
                "Buliding Gui complete".info();
            });
        }
        private void buildGui()
        {
            this.invokeOnThread(
                () =>
            {
                "Buliding Gui for ascx_ExecuteScripts.cs.o2".info();
                // add controls
                statusLabel    = this.parentForm().add_StatusStrip(Color.White);
                this.BackColor = Color.White;
                var topPanel   = this.add_Panel();
                var pictureBox = (PictureBox)topPanel.add_PictureBox();
                //.location(20,20)
                //.align_Bottom(this, 50)
                //.align_Right(this,20);

                /*statusLabel = (Label)topPanel.add_Label("Drop script on logo")
                 *                           .location(this.Height - 40,60)
                 *                           .anchor()
                 *                           .bottom();*/

                //statusLabel.Font = new System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Regular);
                statusLabel.IsLink       = true;
                statusLabel.LinkBehavior = LinkBehavior.NeverUnderline;
                statusLabel.set_Text(welcomeMessage).textColor(this, Color.Black);

                results_RichTextBox = this.add_RichTextBox();

                mainSplitContainer = topPanel.insert_Below(results_RichTextBox, 100)
                                     .get <SplitContainer>();

                mainSplitContainer.panel2Collapsed(true);

                setupPictureBoxContextMenu(pictureBox);


                // load data map actions
                if (pathToPictureBox.fileExists())
                {
                    pictureBox.load(pathToPictureBox);
                }
                else
                {
                    "in ascx_Execute_Scripts.buildGui, could not find pathToPictureBox:{0}".error(pathToPictureBox);
                }


                this.onDrop((file) => loadFile(file));

                statusLabel.Click += (sender, e) => openSimpleScriptEditor();
                //statusLabel.textColor(this, Color.Black);

                // put this on menu item
                //this.add_Link("reload",10,2,()=>loadH2Script());
                "Buliding Gui complete".info();
                return;             // to make this run in sync mode
            });
        }
 public void showError(string errorMessage, string errorDetails)
 {
     statusLabel.set_Text(errorMessage).textColor(this, Color.Red);
     results_RichTextBox.set_Text(errorDetails).textColor(Color.Red);
     mainSplitContainer.panel2Collapsed(false);
 }