コード例 #1
0
ファイル: MshtmlSite.cs プロジェクト: ikvm/webmatrix
 public void CloseMSHTML()
 {
     this.hostControl.Resize -= new EventHandler(this.OnParentResize);
     try
     {
         if (this.propNotifyCookie != null)
         {
             this.propNotifyCookie.Disconnect();
             this.propNotifyCookie = null;
         }
         if (this.tridentDocument != null)
         {
             this.tridentView = null;
             this.tridentDocument = null;
             this.tridentCmdTarget = null;
             this.activeObject = null;
             if (this.adviseSinkCookie != 0)
             {
                 this.tridentOleObject.Unadvise(this.adviseSinkCookie);
                 this.adviseSinkCookie = 0;
             }
             this.tridentOleObject.Close(1);
             this.tridentOleObject.SetClientSite(null);
             this.tridentOleObject = null;
         }
     }
     catch (Exception)
     {
     }
 }
コード例 #2
0
ファイル: Behavior.cs プロジェクト: ikvm/webmatrix
 public void Disconnect()
 {
     if (this._eventSinkCookie != null)
     {
         this._eventSinkCookie.Disconnect();
         this._eventSinkCookie = null;
     }
     this._element = null;
     this._designer = null;
     this._behavior = null;
 }
コード例 #3
0
ファイル: MshtmlSite.cs プロジェクト: ikvm/webmatrix
 public void CreateMSHTML()
 {
     bool flag = false;
     try
     {
         this.tridentDocument = (Interop.IHTMLDocument2) new Interop.HTMLDocument();
         this.tridentOleObject = (Interop.IOleObject) this.tridentDocument;
         this.tridentOleObject.SetClientSite(this);
         flag = true;
         this.propNotifyCookie = new Interop.ConnectionPointCookie(this.tridentDocument, this, typeof(Interop.IPropertyNotifySink), false);
         this.tridentOleObject.Advise(this, out this.adviseSinkCookie);
         this.tridentCmdTarget = (Interop.IOleCommandTarget) this.tridentDocument;
     }
     finally
     {
         if (!flag)
         {
             this.tridentDocument = null;
             this.tridentOleObject = null;
             this.tridentCmdTarget = null;
         }
     }
 }
コード例 #4
0
ファイル: Behavior.cs プロジェクト: ikvm/webmatrix
 public void Connect(Interop.IHTMLElement element)
 {
     this._designer = (ControlDesigner) this._behavior.Designer;
     try
     {
         this._element = element;
         this._eventSinkCookie = new Interop.ConnectionPointCookie(this._element, this, typeof(Interop.IHTMLElementEvents));
     }
     catch (Exception)
     {
     }
 }