Exemple #1
0
        // TODO: Pull this for Mono
        private void StartNewRecording()
        {
            if (this.recordButton.Text == "Start")
            {
                recordButton.Icon      = GetIcon(IconType.Stop);
                this.recordButton.Text = "Stop";

                if (documentContainer1.Documents.Length == 0)
                {
                    documentContainer1.AddDocument(dockControl1);
                    Application.DoEvents();
                }

                this.textScript.Clear();
                AppendText(starterProject, false);
                if (ie != null)
                {
                    ie.Quit();
                    ie = null;
                }
                ie         = new InternetExplorerClass();
                ie.Visible = true;
                object url     = "about:blank";
                object nullObj = String.Empty;
                ie.Navigate2(ref url, ref nullObj, ref nullObj, ref nullObj, ref nullObj);
                ie.DocumentComplete  += new DWebBrowserEvents2_DocumentCompleteEventHandler(ie_DocumentComplete);
                ie.NavigateComplete2 += new DWebBrowserEvents2_NavigateComplete2EventHandler(ie_NavigateComplete2);
                ie.BeforeNavigate2   += new DWebBrowserEvents2_BeforeNavigate2EventHandler(ie_BeforeNavigate2);
            }
            else
            {
                recordButton.Icon      = GetIcon(IconType.Start);
                this.recordButton.Text = "Start";
                AppendText(endProject, false);
                if (ie != null)
                {
                    try
                    {
                        ie.Quit();
                    }
                    catch (COMException)
                    {
                    }
                    finally
                    {
                        ie = null;
                    }
                }
            }
        }