コード例 #1
0
        void initMshtml()
        {
            //don't create in design mode
            if (this.DesignMode)
            {
                return;
            }

            if (this.IsCreated)
            {
                return; //can't create if already created
            }

            // force creating Host handle since we need it to parent MSHTML
            if (!this.IsHandleCreated)
            {
                IntPtr hostHandle = Handle;
            }

            //get the NativeWindow so we hold onto the handle
            //this.mNativeWindow = NativeWindow.FromHandle(Handle);

            site = new HtmlSite(this);
            site.CreateDocument();
            site.ActivateDocument();
            this.m_htmldoc = (HTMLDocument)site.Document;

            if (this.mDesignMode)
            {
                this.m_htmldoc.designMode = "On";
            }

            SetDocEvents();

            if (url != String.Empty)
            {
                LoadUrl(url);
            }
            else
            {
                //always initialize with at least the blank url
                LoadUrl("About:Blank");
            }

            if (sDocument != String.Empty)
            {
                LoadDocument(sDocument);
            }
            else
            {
                if (this.mDesignMode)
                {
                    LoadDocument("<html></html>");
                }
            }
        }
コード例 #2
0
        public void CleanupControl()
        {
            if (IsCreated)
            {
                if (cookie != -1)
                {
                    icp.Unadvise(cookie);
                    cookie = -1;
                }

                site.CloseDocument();
                site.Dispose();
                site           = null;
                this.m_htmldoc = null;
            }
        }
コード例 #3
0
ファイル: HtmlEditor.cs プロジェクト: jpespartero/WorldWind
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 public void CleanupControl()
 {
     if (isCreated)
     {
         site.CloseDocument();
         site.Dispose();
         site = null;
         this.mHtmlDoc = null;
         this.mDocHTML = null;
     }
 }
コード例 #4
0
ファイル: HtmlEditor.cs プロジェクト: jpespartero/WorldWind
        void initMshtml()
        {

            //don't create in design mode
            if (this.DesignMode)
            {
                return;
            }

            if (this.isCreated)
            {
                return; //can't create if already created
            }

            // force creating Host handle since we need it to parent MSHTML
            if (!this.IsHandleCreated)
            {
                IntPtr hostHandle = Handle;
            }

            site = new HtmlSite(this);

            site.CreateDocument();

            if (this.Visible)
            {
                site.ActivateDocument();
            }
            else
            {
                this.bNeedsActivation = true;
                this.activateTimer.Enabled = true;
            }

            this.mHtmlDoc = (HTMLDocument)site.Document;
            this.mDocHTML = new DocHTML(mHtmlDoc);

            if (this.mDesignMode)
            {
                IHTMLDocument2 htmldoc = (IHTMLDocument2)this.mHtmlDoc;
                htmldoc.SetDesignMode("On");

            }

            site.SetPropertyNotifyEvents();

            if (url != String.Empty)
            {
                LoadUrl(url);
            }
            else
            {
                //always initialize with at least the blank url
                LoadUrl("About:Blank");
            }

            if (sDocument != String.Empty)
            {
                LoadDocument(sDocument);
            }
            else
            {
                if (this.mDesignMode)
                {
                    LoadDocument("<html></html>");
                }
            }


        }