Inheritance: System.Attribute
 private PropertyHolder(string name, IExpandoProperty parent, DispIdAttribute dispIdAttribute, ValueHolder value)
 {
     _name = name;
     _dispidAttr = dispIdAttribute;
     _parent = parent;
     _defaultValue = value;
 }
 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);
         }
     }
 }
Example #3
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);
                    }
                }
            }
 public override object[] GetCustomAttributes(bool inherit)
 {
     DispIdAttribute[] attribs = new DispIdAttribute[1];
     attribs[0] = new DispIdAttribute(_dispId);
     return attribs;
 }
Example #5
0
 internal MethodHolder(string name, Delegate target, int dispId)
 {
     _name = name;
     _target = target;
     _dispidAttr = new DispIdAttribute(dispId);
 }
Example #6
0
 public MethodHolder(string name, Delegate target)
 {
     _name = name;
     _target = target;
     _dispidAttr = new DispIdAttribute(DispidGenerator.Take());
 }
Example #7
0
 public MethodHolder(string name)
 {
     _name = name;
     _dispidAttr = new DispIdAttribute(DispidGenerator.Take());
 }
        public static void Ctor_Value(int dispId)
        {
            var attribute = new DispIdAttribute(dispId);

            Assert.Equal(dispId, attribute.Value);
        }
Example #9
0
 private FieldHolder(string name, DispIdAttribute dispIdAttribute, ValueHolder value)
 {
     _name = name;
     _dispidAttr = dispIdAttribute;
     _defaultValue = value;
 }
Example #10
0
 public FieldHolder(string name, int dispId)
 {
     _name = name;
     _dispidAttr = new DispIdAttribute(dispId);
 }
Example #11
0
 public PropertyHolder(string name, int dispId)
 {
     _name = name;
     _dispidAttr = new DispIdAttribute(dispId);
 }
Example #12
0
 public PropertyHolder(string name, IExpandoProperty parent)
 {
     _name = name;
     _dispidAttr = new DispIdAttribute(DispidGenerator.Take());
     _parent = parent;
 }