Inheritance: System.Attribute
示例#1
0
 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);
         }
     }
 }
示例#3
0
文件: AxHost.cs 项目: JianwenSun/cc
            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);
                    }
                }
            }
示例#4
0
 public override object[] GetCustomAttributes(bool inherit)
 {
     DispIdAttribute[] attribs = new DispIdAttribute[1];
     attribs[0] = new DispIdAttribute(_dispId);
     return attribs;
 }
示例#5
0
 internal MethodHolder(string name, Delegate target, int dispId)
 {
     _name = name;
     _target = target;
     _dispidAttr = new DispIdAttribute(dispId);
 }
示例#6
0
 public MethodHolder(string name, Delegate target)
 {
     _name = name;
     _target = target;
     _dispidAttr = new DispIdAttribute(DispidGenerator.Take());
 }
示例#7
0
 public MethodHolder(string name)
 {
     _name = name;
     _dispidAttr = new DispIdAttribute(DispidGenerator.Take());
 }
示例#8
0
        public static void Ctor_Value(int dispId)
        {
            var attribute = new DispIdAttribute(dispId);

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