Ejemplo n.º 1
0
 internal State(AxHost ctl)
 {
     CreateStorage();
     manualUpdate = ctl.GetAxState(AxHost.manualUpdate);
     licenseKey   = ctl.GetLicenseKey();
     type         = STG_STORAGE;
 }
Ejemplo n.º 2
0
 // create on init new w/ storage...
 internal State(AxHost control)
 {
     CreateStorage();
     _manualUpdate = control.GetAxState(s_manualUpdate);
     _licenseKey   = control.GetLicenseKey();
     Type          = STG_STORAGE;
 }
 public AxPerPropertyBrowsingEnum(AxPropertyDescriptor targetObject, AxHost owner, OleStrCAMarshaler names, Int32CAMarshaler values, bool allowUnknowns) : base(Array.Empty <string>(), Array.Empty <object>(), allowUnknowns)
 {
     target          = targetObject;
     nameMarshaller  = names;
     valueMarshaller = values;
     this.owner      = owner;
     arraysFetched   = false;
 }
Ejemplo n.º 4
0
 // create on save from ipersist stream
 internal State(MemoryStream memoryStream, int storageType, AxHost control, PropertyBagStream propertyBag)
 {
     Type         = storageType;
     _propertyBag = propertyBag;
     // dangerous?
     _length       = (int)memoryStream.Length;
     _memoryStream = memoryStream;
     _manualUpdate = control.GetAxState(s_manualUpdate);
     _licenseKey   = control.GetLicenseKey();
 }
Ejemplo n.º 5
0
 internal State(MemoryStream ms, int storageType, AxHost ctl, PropertyBagStream propBag)
 {
     type = storageType;
     PropertyBagBinary = propBag;
     // dangerous?
     length       = (int)ms.Length;
     this.ms      = ms;
     manualUpdate = ctl.GetAxState(AxHost.manualUpdate);
     licenseKey   = ctl.GetLicenseKey();
 }
 public AxPerPropertyBrowsingEnum(
     AxPropertyDescriptor targetObject,
     AxHost owner,
     string[] names,
     uint[] cookies)
 {
     _target        = targetObject;
     _names         = names;
     _cookies       = cookies;
     _owner         = owner;
     _arraysFetched = false;
 }
            internal AxPropertyDescriptor(PropertyDescriptor baseProp, AxHost owner) : base(baseProp)
            {
                this.baseProp = baseProp;
                this.owner    = owner;

                // Get the category for this dispid.
                //
                dispid = (DispIdAttribute)baseProp.Attributes[typeof(DispIdAttribute)];
                if (dispid != null)
                {
                    // Look to see if this property has a property page.
                    // If it does, then it needs to be Browsable(true).
                    //
                    if (!IsBrowsable && !IsReadOnly)
                    {
                        Guid g = GetPropertyPage((Ole32.DispatchID)dispid.Value);
                        if (!Guid.Empty.Equals(g))
                        {
                            Debug.WriteLineIf(AxPropTraceSwitch.TraceVerbose, "Making property: " + Name + " browsable because we found an property page.");
                            AddAttribute(new BrowsableAttribute(true));
                        }
                    }

                    // Use the CategoryAttribute provided by the OCX.
                    CategoryAttribute cat = owner.GetCategoryForDispid((Ole32.DispatchID)dispid.Value);
                    if (cat != null)
                    {
                        AddAttribute(cat);
                    }

                    // Check to see if this a DataSource property.
                    // If it is, we can always get and set the value of this property.
                    //
                    if (PropertyType.GUID.Equals(dataSource_Guid))
                    {
                        SetFlag(FlagIgnoreCanAccessProperties, true);
                    }
                }
            }
Ejemplo n.º 8
0
        internal RdpClient(ContainerControl parent, Size size, EventHandler resizeHandler)
        {
            this.parent = parent;
            this.size = size;
            try
            {
                rdpControl = rdpClient6 = new MsRdpClient6();
                RDPConfigure(size);

                // CA-96135: Try adding rdpControl to parent.Controls list; this will throw exception when
                // MsRdpClient6 control cannot be created (there is no appropriate version of dll present)
                parent.Controls.Add(rdpControl);
            }
            catch
            {
                if (parent.Controls.Contains(rdpControl))
                    parent.Controls.Remove(rdpControl);
                rdpClient6 = null;
                rdpControl = rdpClient2 = new MsRdpClient2();
                RDPConfigure(size);
                parent.Controls.Add(rdpControl);
            }
            rdpControl.Resize += resizeHandler;
        }
Ejemplo n.º 9
0
            internal AxPropertyDescriptor(PropertyDescriptor baseDescriptor, AxHost owner) : base(baseDescriptor)
            {
                _baseDescriptor = baseDescriptor;
                _owner          = owner;

                // Get the category for this dispid.
                _dispid = baseDescriptor.GetAttribute <DispIdAttribute>();
                if (_dispid is not null)
                {
                    // Look to see if this property has a property page.
                    // If it does, then it needs to be Browsable(true).
                    if (!IsBrowsable && !IsReadOnly)
                    {
                        Guid g = GetPropertyPage((Ole32.DispatchID)_dispid.Value);
                        if (!Guid.Empty.Equals(g))
                        {
                            Debug.WriteLineIf(s_axPropTraceSwitch.TraceVerbose, $"Making property: {Name} browsable because we found an property page.");
                            AddAttribute(new BrowsableAttribute(true));
                        }
                    }

                    // Use the CategoryAttribute provided by the OCX.
                    CategoryAttribute cat = owner.GetCategoryForDispid((Ole32.DispatchID)_dispid.Value);
                    if (cat is not null)
                    {
                        AddAttribute(cat);
                    }

                    // Check to see if this a DataSource property.
                    // If it is, we can always get and set the value of this property.
                    if (PropertyType.GUID.Equals(s_dataSource_Guid))
                    {
                        SetFlag(FlagIgnoreCanAccessProperties, true);
                    }
                }
            }
 public AxEnumConverter(AxHost.AxPropertyDescriptor target, Com2Enum com2Enum) : base(com2Enum)
 {
     this.target = target;
 }
 internal AxPropertyDescriptor(PropertyDescriptor baseProp, AxHost owner) : base(baseProp)
 {
     this.updateAttrs = new ArrayList();
     this.baseProp = baseProp;
     this.owner = owner;
     this.dispid = (DispIdAttribute) baseProp.Attributes[typeof(DispIdAttribute)];
     if (this.dispid != null)
     {
         if (!this.IsBrowsable && !this.IsReadOnly)
         {
             Guid propertyPage = this.GetPropertyPage(this.dispid.Value);
             if (!Guid.Empty.Equals(propertyPage))
             {
                 this.AddAttribute(new BrowsableAttribute(true));
             }
         }
         CategoryAttribute categoryForDispid = owner.GetCategoryForDispid(this.dispid.Value);
         if (categoryForDispid != null)
         {
             this.AddAttribute(categoryForDispid);
         }
         if (this.PropertyType.GUID.Equals(AxHost.dataSource_Guid))
         {
             this.SetFlag(8, true);
         }
     }
 }
 internal void OnUIDeactivate(AxHost site)
 {
     this.siteUIActive = null;
     site.RemoveSelectionHandler();
     site.SetSelectionStyle(1);
     site.editMode = 0;
     if (site.GetSiteOwnsDeactivation())
     {
         ContainerControl containingControl = site.ContainingControl;
     }
 }
 int System.Windows.Forms.UnsafeNativeMethods.IOleInPlaceFrame.SetActiveObject(System.Windows.Forms.UnsafeNativeMethods.IOleInPlaceActiveObject pActiveObject, string pszObjName)
 {
     if ((this.siteUIActive != null) && (this.siteUIActive.iOleInPlaceActiveObjectExternal != pActiveObject))
     {
         if (this.siteUIActive.iOleInPlaceActiveObjectExternal != null)
         {
             Marshal.ReleaseComObject(this.siteUIActive.iOleInPlaceActiveObjectExternal);
         }
         this.siteUIActive.iOleInPlaceActiveObjectExternal = pActiveObject;
     }
     if (pActiveObject == null)
     {
         if (this.ctlInEditMode != null)
         {
             this.ctlInEditMode.editMode = 0;
             this.ctlInEditMode = null;
         }
         return 0;
     }
     AxHost axHost = null;
     if (pActiveObject is System.Windows.Forms.UnsafeNativeMethods.IOleObject)
     {
         System.Windows.Forms.UnsafeNativeMethods.IOleObject obj2 = (System.Windows.Forms.UnsafeNativeMethods.IOleObject) pActiveObject;
         System.Windows.Forms.UnsafeNativeMethods.IOleClientSite clientSite = null;
         try
         {
             clientSite = obj2.GetClientSite();
             if (clientSite is AxHost.OleInterfaces)
             {
                 axHost = ((AxHost.OleInterfaces) clientSite).GetAxHost();
             }
         }
         catch (COMException)
         {
         }
         if (this.ctlInEditMode != null)
         {
             this.ctlInEditMode.SetSelectionStyle(1);
             this.ctlInEditMode.editMode = 0;
         }
         if (axHost == null)
         {
             this.ctlInEditMode = null;
         }
         else if (!axHost.IsUserMode())
         {
             this.ctlInEditMode = axHost;
             axHost.editMode = 1;
             axHost.AddSelectionHandler();
             axHost.SetSelectionStyle(2);
         }
     }
     return 0;
 }
 /// <summary>
 /// Returns an observable sequence wrapping the DragLeave event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the DragLeave event on the AxHost instance.</returns>
 public static IObservable <EventPattern <EventArgs> > DragLeaveObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <EventHandler, EventArgs>(
                handler => instance.DragLeave += handler,
                handler => instance.DragLeave -= handler));
 }
 /// <summary>
 /// Returns an observable sequence wrapping the RightToLeftChanged event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the RightToLeftChanged event on the AxHost instance.</returns>
 public static IObservable <EventPattern <EventArgs> > RightToLeftChangedObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <EventHandler, EventArgs>(
                handler => instance.RightToLeftChanged += handler,
                handler => instance.RightToLeftChanged -= handler));
 }
 /// <summary>
 /// Returns an observable sequence wrapping the BackgroundImageLayoutChanged event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the BackgroundImageLayoutChanged event on the AxHost instance.</returns>
 public static IObservable <EventPattern <EventArgs> > BackgroundImageLayoutChangedObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <EventHandler, EventArgs>(
                handler => instance.BackgroundImageLayoutChanged += handler,
                handler => instance.BackgroundImageLayoutChanged -= handler));
 }
 internal State(MemoryStream ms, int storageType, AxHost ctl, AxHost.PropertyBagStream propBag)
 {
     this.VERSION = 1;
     this.type = storageType;
     this.propBag = propBag;
     this.length = (int) ms.Length;
     this.ms = ms;
     this.manualUpdate = ctl.GetAxState(AxHost.manualUpdate);
     this.licenseKey = ctl.GetLicenseKey();
 }
 /// <summary>
 /// Returns an observable sequence wrapping the MouseWheel event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the MouseWheel event on the AxHost instance.</returns>
 public static IObservable <EventPattern <MouseEventArgs> > MouseWheelObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <MouseEventHandler, MouseEventArgs>(
                handler => instance.MouseWheel += handler,
                handler => instance.MouseWheel -= handler));
 }
 /// <summary>
 /// Returns an observable sequence wrapping the ChangeUICues event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the ChangeUICues event on the AxHost instance.</returns>
 public static IObservable <EventPattern <UICuesEventArgs> > ChangeUICuesObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <UICuesEventHandler, UICuesEventArgs>(
                handler => instance.ChangeUICues += handler,
                handler => instance.ChangeUICues -= handler));
 }
 /// <summary>
 /// Returns an observable sequence wrapping the MouseHover event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the MouseHover event on the AxHost instance.</returns>
 public static IObservable <EventPattern <EventArgs> > MouseHoverObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <EventHandler, EventArgs>(
                handler => instance.MouseHover += handler,
                handler => instance.MouseHover -= handler));
 }
 /// <summary>
 /// Returns an observable sequence wrapping the Layout event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the Layout event on the AxHost instance.</returns>
 public static IObservable <EventPattern <LayoutEventArgs> > LayoutObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <LayoutEventHandler, LayoutEventArgs>(
                handler => instance.Layout += handler,
                handler => instance.Layout -= handler));
 }
 /// <summary>
 /// Returns an observable sequence wrapping the KeyUp event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the KeyUp event on the AxHost instance.</returns>
 public static IObservable <EventPattern <KeyEventArgs> > KeyUpObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <KeyEventHandler, KeyEventArgs>(
                handler => instance.KeyUp += handler,
                handler => instance.KeyUp -= handler));
 }
 public InvalidActiveXStateException(string name, AxHost.ActiveXInvokeKind kind)
 {
     this.name = name;
     this.kind = kind;
 }
 /// <summary>
 /// Returns an observable sequence wrapping the ContextMenuChanged event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the ContextMenuChanged event on the AxHost instance.</returns>
 public static IObservable <EventPattern <EventArgs> > ContextMenuChangedObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <EventHandler, EventArgs>(
                handler => instance.ContextMenuChanged += handler,
                handler => instance.ContextMenuChanged -= handler));
 }
 internal State(AxHost ctl)
 {
     this.VERSION = 1;
     this.CreateStorage();
     this.manualUpdate = ctl.GetAxState(AxHost.manualUpdate);
     this.licenseKey = ctl.GetLicenseKey();
     this.type = 2;
 }
Ejemplo n.º 26
0
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 internal void OnInPlaceDeactivate(AxHost site) {
     if (siteActive == site) {
         siteActive = null;
         if (site.GetSiteOwnsDeactivation()) {
             parent.ActiveControl = null;
         }
         else {
             // we need to tell the form to switch activation to the next thingie...
             Debug.Fail("what pathological control is calling inplacedeactivate by itself?");
         }
     }
 }
 /// <summary>
 /// Returns an observable sequence wrapping the HelpRequested event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the HelpRequested event on the AxHost instance.</returns>
 public static IObservable <EventPattern <HelpEventArgs> > HelpRequestedObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <HelpEventHandler, HelpEventArgs>(
                handler => instance.HelpRequested += handler,
                handler => instance.HelpRequested -= handler));
 }
Ejemplo n.º 28
0
            /// <devdoc>
            ///    <para>[To be supplied.]</para>
            /// </devdoc>
            internal void OnUIDeactivate(AxHost site) {
#if DEBUG
                if (siteUIActive != null)
                    Debug.Assert(siteUIActive == site, "deactivating when not active...");
#endif // DEBUG

                siteUIActive = null;
                site.RemoveSelectionHandler();
                site.SetSelectionStyle(1);
                site.editMode = EDITM_NONE;
                if (site.GetSiteOwnsDeactivation()) {
                    Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, " our site owns deactivation ");
                    ContainerControl f = site.ContainingControl;
                    Debug.Assert(f != null, "a control has to be on a ContainerControl...");
                    if (f != null) {
                        //    f.setActiveControl(null);
                    }
                }
            }
 /// <summary>
 /// Returns an observable sequence wrapping the DoubleClick event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the DoubleClick event on the AxHost instance.</returns>
 public static IObservable <EventPattern <EventArgs> > DoubleClickObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <EventHandler, EventArgs>(
                handler => instance.DoubleClick += handler,
                handler => instance.DoubleClick -= handler));
 }
Ejemplo n.º 30
0
            /// <devdoc>
            ///    <para>[To be supplied.]</para>
            /// </devdoc>
            internal void OnUIActivate(AxHost site) {
                // The ShDocVw control repeatedly calls OnUIActivate() with the same
                // site. This causes the assert below to fire.
                //
                if (siteUIActive == site)
                    return;

                if (siteUIActive != null && siteUIActive != site) {
                    AxHost tempSite = siteUIActive;
                    bool ownDisposing = tempSite.GetAxState(AxHost.ownDisposing);
                    try {
                        tempSite.SetAxState(AxHost.ownDisposing, true);
                        tempSite.GetInPlaceObject().UIDeactivate();
                    }
                    finally {
                        tempSite.SetAxState(AxHost.ownDisposing, ownDisposing);
                    }
                }
                site.AddSelectionHandler();
                Debug.Assert(siteUIActive == null, "Object did not call OnUIDeactivate");
                Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "active Object is now "+site.ToString());
                siteUIActive = site;
                ContainerControl f = site.ContainingControl;
                Debug.Assert(f != null, "a control has to be on a ContainerControl...");
                if (f != null) {
                    f.ActiveControl = site;
                }
            }
 /// <summary>
 /// Returns an observable sequence wrapping the QueryContinueDrag event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the QueryContinueDrag event on the AxHost instance.</returns>
 public static IObservable <EventPattern <QueryContinueDragEventArgs> > QueryContinueDragObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <QueryContinueDragEventHandler, QueryContinueDragEventArgs>(
                handler => instance.QueryContinueDrag += handler,
                handler => instance.QueryContinueDrag -= handler));
 }
Ejemplo n.º 32
0
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 internal void ControlCreated(AxHost invoker) {
     Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "in controlCreated for "+invoker.ToString()+" fAC: "+formAlreadyCreated.ToString());
     if (formAlreadyCreated) {
         if (invoker.IsUserMode() && invoker.AwaitingDefreezing()) {
             invoker.Freeze(false);
         }
     }
     else {
         // the form will be created in the future
         parent.CreateAxContainer();
     }
 }
 private bool RegisterControl(AxHost ctl)
 {
     ISite site = ctl.Site;
     if (site != null)
     {
         IContainer container = site.Container;
         if (container != null)
         {
             if (this.assocContainer != null)
             {
                 return (container == this.assocContainer);
             }
             this.assocContainer = container;
             IComponentChangeService service = (IComponentChangeService) site.GetService(typeof(IComponentChangeService));
             if (service != null)
             {
                 service.ComponentRemoved += new ComponentEventHandler(this.OnComponentRemoved);
             }
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 34
0
 internal void FormCreated() {
     if (formAlreadyCreated) return;
     formAlreadyCreated = true;
     ArrayList l = new ArrayList();
     ListAxControls(l, false);
     AxHost[] axControls = new AxHost[l.Count];
     l.CopyTo(axControls, 0);
     for (int i = 0; i < axControls.Length; i++) {
         AxHost control = axControls[i];
         if (control.GetOcState() >= OC_RUNNING && control.IsUserMode() && control.AwaitingDefreezing()) {
             control.Freeze(false);
         }
     }
 }
 internal ExtenderProxy(Control principal, AxHost.AxContainer container)
 {
     this.pRef = new WeakReference(principal);
     this.pContainer = new WeakReference(container);
 }
Ejemplo n.º 36
0
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 internal void OnExitEditMode(AxHost ctl) {
     Debug.Assert(ctlInEditMode == null || ctlInEditMode == ctl, "who is exiting edit mode?");
     if (ctlInEditMode == null || ctlInEditMode != ctl) return;
     ctlInEditMode = null;
 }
 public AxPerPropertyBrowsingEnum(AxHost.AxPropertyDescriptor targetObject, AxHost owner, OleStrCAMarshaler names, Int32CAMarshaler values, bool allowUnknowns) : base(new string[0], new object[0], allowUnknowns)
 {
     this.target = targetObject;
     this.nameMarshaller = names;
     this.valueMarshaller = values;
     this.owner = owner;
     this.arraysFetched = false;
 }
Ejemplo n.º 38
0
 /// <include file='doc\AxHost.uex' path='docs/doc[@for="AxHost.AxContainer.SetActiveObject"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 int UnsafeNativeMethods.IOleInPlaceFrame.SetActiveObject(UnsafeNativeMethods.IOleInPlaceActiveObject pActiveObject, string pszObjName) {
     Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "in SetActiveObject " + ((pszObjName == null) ? "<null>" : pszObjName));
     if (siteUIActive != null) {
         if (siteUIActive.iOleInPlaceActiveObjectExternal != pActiveObject) {
             if (siteUIActive.iOleInPlaceActiveObjectExternal != null) {
                 Marshal.ReleaseComObject(siteUIActive.iOleInPlaceActiveObjectExternal);
             }
             siteUIActive.iOleInPlaceActiveObjectExternal = pActiveObject;
         }
     }
     if (pActiveObject == null) {
         if (ctlInEditMode != null) {
             ctlInEditMode.editMode = EDITM_NONE;
             ctlInEditMode = null;
         }
         return NativeMethods.S_OK;
     }
     AxHost ctl = null;
     if (pActiveObject is UnsafeNativeMethods.IOleObject) {
         UnsafeNativeMethods.IOleObject oleObject = (UnsafeNativeMethods.IOleObject) pActiveObject;
         UnsafeNativeMethods.IOleClientSite clientSite = null;
         try {
             clientSite = oleObject.GetClientSite();
             if (clientSite is OleInterfaces) {
                 ctl = ((OleInterfaces)(clientSite)).GetAxHost();
             }
         }
         catch (COMException t) {
             Debug.Fail(t.ToString());
         }
         if (ctlInEditMode != null) {
             Debug.Fail("control " + ctlInEditMode.ToString() + " did not reset its edit mode to null");
             ctlInEditMode.SetSelectionStyle(1);
             ctlInEditMode.editMode = EDITM_NONE;
         }
         
         if (ctl == null) {
             Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "control w/o a valid site called setactiveobject");
             ctlInEditMode = null;
         }
         else {
             Debug.WriteLineIf(AxHTraceSwitch.TraceVerbose, "resolved to " + ctl.ToString());
             if (!ctl.IsUserMode()) {
                 ctlInEditMode = ctl;
                 ctl.editMode = EDITM_OBJECT;
                 ctl.AddSelectionHandler();
                 ctl.SetSelectionStyle(2);
             }
         }
     }
     return NativeMethods.S_OK;
 }
 public AxPropertyTypeEditor(AxHost.AxPropertyDescriptor pd, Guid guid)
 {
     this.propDesc = pd;
     this.guid = guid;
 }
Ejemplo n.º 40
0
 // create on init new w/ storage...
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 internal State(AxHost ctl) {
     CreateStorage();
     manualUpdate = ctl.GetAxState(AxHost.manualUpdate);
     licenseKey = ctl.GetLicenseKey();
     type = STG_STORAGE;
 }
 internal OleInterfaces(AxHost host)
 {
     if (host == null)
     {
         throw new ArgumentNullException("host");
     }
     this.host = host;
 }
Ejemplo n.º 42
0
            internal AxPropertyDescriptor(PropertyDescriptor baseProp, AxHost owner) : base(baseProp) {
                this.baseProp = baseProp;
                this.owner = owner;

                // Get the category for this dispid.
                //
                dispid = (DispIdAttribute)baseProp.Attributes[typeof(DispIdAttribute)];
                if (dispid != null) {
                    // Look to see if this property has a property page.
                    // If it does, then it needs to be Browsable(true).
                    //
                    if (!this.IsBrowsable && !this.IsReadOnly) {
                        Guid g = GetPropertyPage(dispid.Value);
    
                        if (!Guid.Empty.Equals(g)) {
                           Debug.WriteLineIf(AxPropTraceSwitch.TraceVerbose, "Making property: " + this.Name + " browsable because we found an property page.");
                           AddAttribute(new BrowsableAttribute(true));
                        }
                    }
                    
                    // Use the CategoryAttribute provided by the OCX.
                    //
                    CategoryAttribute cat = owner.GetCategoryForDispid(dispid.Value);
                    if (cat != null) {
                        AddAttribute(cat);
                    }

                    // Check to see if this a DataSource property.
                    // If it is, we can always get and set the value of this property.
                    //
                    if (this.PropertyType.GUID.Equals(dataSource_Guid)) {
                        SetFlag(FlagIgnoreCanAccessProperties, true);
                    }
                }
            }
 internal State(AxHost.PropertyBagStream propBag)
 {
     this.VERSION = 1;
     this.propBag = propBag;
 }
 internal void ControlCreated(AxHost invoker)
 {
     if (this.formAlreadyCreated)
     {
         if (invoker.IsUserMode() && invoker.AwaitingDefreezing())
         {
             invoker.Freeze(false);
         }
     }
     else
     {
         this.parent.CreateAxContainer();
     }
 }
Ejemplo n.º 45
0
		protected void SetAboutBoxDelegate (AxHost.AboutBoxDelegate d)
		{
			throw new NotImplementedException("COM/ActiveX support is not implemented");
		}
Ejemplo n.º 46
0
 internal OleInterfaces(AxHost host)
 {
     _host = host.OrThrowIfNull();
 }
 /// <summary>
 /// Returns an observable sequence wrapping the GiveFeedback event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the GiveFeedback event on the AxHost instance.</returns>
 public static IObservable <EventPattern <GiveFeedbackEventArgs> > GiveFeedbackObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <GiveFeedbackEventHandler, GiveFeedbackEventArgs>(
                handler => instance.GiveFeedback += handler,
                handler => instance.GiveFeedback -= handler));
 }
Ejemplo n.º 48
0
		protected void SetAboutBoxDelegate (AxHost.AboutBoxDelegate d)
		{
			this.aboutDelegate = d;
		}
 /// <summary>
 /// Returns an observable sequence wrapping the DragOver event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the DragOver event on the AxHost instance.</returns>
 public static IObservable <EventPattern <DragEventArgs> > DragOverObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <DragEventHandler, DragEventArgs>(
                handler => instance.DragOver += handler,
                handler => instance.DragOver -= handler));
 }
 /// <summary>
 /// Returns an observable sequence wrapping the QueryAccessibilityHelp event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the QueryAccessibilityHelp event on the AxHost instance.</returns>
 public static IObservable <EventPattern <QueryAccessibilityHelpEventArgs> > QueryAccessibilityHelpObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <QueryAccessibilityHelpEventHandler, QueryAccessibilityHelpEventArgs>(
                handler => instance.QueryAccessibilityHelp += handler,
                handler => instance.QueryAccessibilityHelp -= handler));
 }
 internal void OnExitEditMode(AxHost ctl)
 {
     if ((this.ctlInEditMode != null) && (this.ctlInEditMode == ctl))
     {
         this.ctlInEditMode = null;
     }
 }
 internal void OnInPlaceDeactivate(AxHost site)
 {
     if (this.siteActive == site)
     {
         this.siteActive = null;
         if (site.GetSiteOwnsDeactivation())
         {
             this.parent.ActiveControl = null;
         }
     }
 }
Ejemplo n.º 53
0
 internal OleInterfaces(AxHost host)
 {
     this.host = host ?? throw new ArgumentNullException(nameof(host));
 }
 internal void OnUIActivate(AxHost site)
 {
     if (this.siteUIActive != site)
     {
         if ((this.siteUIActive != null) && (this.siteUIActive != site))
         {
             AxHost siteUIActive = this.siteUIActive;
             bool axState = siteUIActive.GetAxState(AxHost.ownDisposing);
             try
             {
                 siteUIActive.SetAxState(AxHost.ownDisposing, true);
                 siteUIActive.GetInPlaceObject().UIDeactivate();
             }
             finally
             {
                 siteUIActive.SetAxState(AxHost.ownDisposing, axState);
             }
         }
         site.AddSelectionHandler();
         this.siteUIActive = site;
         ContainerControl containingControl = site.ContainingControl;
         if (containingControl != null)
         {
             containingControl.ActiveControl = site;
         }
     }
 }
 internal void FormCreated()
 {
     if (!this.formAlreadyCreated)
     {
         this.formAlreadyCreated = true;
         ArrayList list = new ArrayList();
         this.ListAxControls(list, false);
         AxHost[] array = new AxHost[list.Count];
         list.CopyTo(array, 0);
         for (int i = 0; i < array.Length; i++)
         {
             AxHost host = array[i];
             if (((host.GetOcState() >= 2) && host.IsUserMode()) && host.AwaitingDefreezing())
             {
                 host.Freeze(false);
             }
         }
     }
 }
 /// <summary>
 /// Returns an observable sequence wrapping the Paint event on the AxHost instance.
 /// </summary>
 /// <param name="instance">The AxHost instance to observe.</param>
 /// <returns>An observable sequence wrapping the Paint event on the AxHost instance.</returns>
 public static IObservable <EventPattern <PaintEventArgs> > PaintObservable(this AxHost instance)
 {
     return(Observable.FromEventPattern <PaintEventHandler, PaintEventArgs>(
                handler => instance.Paint += handler,
                handler => instance.Paint -= handler));
 }