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); } } }
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); } } }
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 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); } } }