Exemple #1
0
 public virtual void GetOleVerbs(DesignerVerbCollection rval)
 {
     System.Design.NativeMethods.IEnumOLEVERB e   = null;
     System.Design.NativeMethods.IOleObject   ocx = this.axHost.GetOcx() as System.Design.NativeMethods.IOleObject;
     if ((ocx == null) || System.Design.NativeMethods.Failed(ocx.EnumVerbs(out e)))
     {
         return;
     }
     if (e == null)
     {
         return;
     }
     int[] pceltFetched = new int[1];
     System.Design.NativeMethods.tagOLEVERB rgelt = new System.Design.NativeMethods.tagOLEVERB();
     this.foundEdit       = false;
     this.foundAbout      = false;
     this.foundProperties = false;
     while (true)
     {
         pceltFetched[0]    = 0;
         rgelt.lpszVerbName = null;
         int hr = e.Next(1, rgelt, pceltFetched);
         if ((hr == 1) || System.Design.NativeMethods.Failed(hr))
         {
             return;
         }
         if ((rgelt.grfAttribs & 2) != 0)
         {
             this.foundEdit       = this.foundEdit || (rgelt.lVerb == -4);
             this.foundAbout      = this.foundAbout || (rgelt.lVerb == 2);
             this.foundProperties = this.foundProperties || (rgelt.lVerb == 1);
             rval.Add(new HostVerb(new OleVerbData(rgelt), this.handler));
         }
     }
 }
 protected void CreateDocument()
 {
     try
     {
         this.tridentDocument  = (System.Design.NativeMethods.IHTMLDocument2) new System.Design.NativeMethods.HTMLDocument();
         this.tridentOleObject = (System.Design.NativeMethods.IOleObject) this.tridentDocument;
         this.tridentOleObject.SetClientSite(this);
         ((System.Design.NativeMethods.IPersistStreamInit) this.tridentDocument).InitNew();
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
 protected void CreateDocument()
 {
     try
     {
         this.tridentDocument = (System.Design.NativeMethods.IHTMLDocument2) new System.Design.NativeMethods.HTMLDocument();
         this.tridentOleObject = (System.Design.NativeMethods.IOleObject) this.tridentDocument;
         this.tridentOleObject.SetClientSite(this);
         ((System.Design.NativeMethods.IPersistStreamInit) this.tridentDocument).InitNew();
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }