/// <devdoc>
 ///     Creates a new ExtenderProvidedPropertyAttribute.
 /// </devdoc>
 internal static ExtenderProvidedPropertyAttribute Create(PropertyDescriptor extenderProperty, Type receiverType, IExtenderProvider provider) {
     ExtenderProvidedPropertyAttribute e = new ExtenderProvidedPropertyAttribute();
     e.extenderProperty = extenderProperty;
     e.receiverType = receiverType;
     e.provider = provider;
     return e;
 }
		// Call this method to create a ExtenderProvidedPropertyAttribute and set it's values
		internal static ExtenderProvidedPropertyAttribute CreateAttribute (PropertyDescriptor extenderProperty, IExtenderProvider provider, Type receiverType)
		{
			ExtenderProvidedPropertyAttribute NewAttribute = new ExtenderProvidedPropertyAttribute();
			NewAttribute.extender = extenderProperty;
			NewAttribute.receiver = receiverType;
			NewAttribute.extenderProvider = provider;
			return NewAttribute; 
		}
Exemplo n.º 3
0
        public ExtendedPropertyDescriptor(PropertyDescriptor extender, Attribute[] attributes) : base(extender, attributes)
        {
            ExtenderProvidedPropertyAttribute attribute        = extender.Attributes[typeof(ExtenderProvidedPropertyAttribute)] as ExtenderProvidedPropertyAttribute;
            ReflectPropertyDescriptor         extenderProperty = attribute.ExtenderProperty as ReflectPropertyDescriptor;

            this.extenderInfo = extenderProperty;
            this.provider     = attribute.Provider;
        }
        /// <devdoc>
        ///     Creates a new ExtenderProvidedPropertyAttribute.
        /// </devdoc>
        internal static ExtenderProvidedPropertyAttribute Create(PropertyDescriptor extenderProperty, Type receiverType, IExtenderProvider provider)
        {
            ExtenderProvidedPropertyAttribute e = new ExtenderProvidedPropertyAttribute();

            e.extenderProperty = extenderProperty;
            e.receiverType     = receiverType;
            e.provider         = provider;
            return(e);
        }
Exemplo n.º 5
0
        // Call this method to create a ExtenderProvidedPropertyAttribute and set it's values
        internal static ExtenderProvidedPropertyAttribute CreateAttribute(PropertyDescriptor extenderProperty, IExtenderProvider provider, Type receiverType)
        {
            ExtenderProvidedPropertyAttribute NewAttribute = new ExtenderProvidedPropertyAttribute();

            NewAttribute.extender         = extenderProperty;
            NewAttribute.receiver         = receiverType;
            NewAttribute.extenderProvider = provider;
            return(NewAttribute);
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            ExtenderProvidedPropertyAttribute attribute = obj as ExtenderProvidedPropertyAttribute;

            return((((attribute != null) && attribute.extenderProperty.Equals(this.extenderProperty)) && attribute.provider.Equals(this.provider)) && attribute.receiverType.Equals(this.receiverType));
        }
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            ExtenderProvidedPropertyAttribute other = obj as ExtenderProvidedPropertyAttribute;

            return((other != null) && other.extenderProperty.Equals(extenderProperty) && other.provider.Equals(provider) && other.receiverType.Equals(receiverType));
        }
Exemplo n.º 8
0
        public ExtendedPropertyDescriptor(ReflectPropertyDescriptor extenderInfo, Type receiverType, IExtenderProvider provider, Attribute[] attributes) : base(extenderInfo, attributes)
        {
            ArrayList list = new ArrayList(this.AttributeArray);

            list.Add(ExtenderProvidedPropertyAttribute.Create(extenderInfo, receiverType, provider));
            if (extenderInfo.IsReadOnly)
            {
                list.Add(ReadOnlyAttribute.Yes);
            }
            Attribute[] array = new Attribute[list.Count];
            list.CopyTo(array, 0);
            this.AttributeArray = array;
            this.extenderInfo   = extenderInfo;
            this.provider       = provider;
        }
        public ExtendedPropertyDescriptor(PropertyDescriptor extender, Attribute[] attributes) : base(extender, attributes)
        {
            Debug.Assert(extender != null, "The original PropertyDescriptor must be non-null");

            ExtenderProvidedPropertyAttribute attr = extender.Attributes[typeof(ExtenderProvidedPropertyAttribute)] as ExtenderProvidedPropertyAttribute;

            Debug.Assert(attr != null, "The original PropertyDescriptor does not have an ExtenderProvidedPropertyAttribute");


            ReflectPropertyDescriptor reflectDesc = attr.ExtenderProperty as ReflectPropertyDescriptor;

            Debug.Assert(reflectDesc != null, "The original PropertyDescriptor has an invalid ExtenderProperty");

            _extenderInfo = reflectDesc;
            _provider     = attr.Provider;
        }
        private readonly IExtenderProvider _provider;             // the guy providing it

        /// <summary>
        ///     Creates a new extended property info.  Callers can then treat this as
        ///     a standard property.
        /// </summary>
        public ExtendedPropertyDescriptor(ReflectPropertyDescriptor extenderInfo, Type receiverType, IExtenderProvider provider, Attribute[] attributes)
            : base(extenderInfo, attributes)
        {
            Debug.Assert(extenderInfo != null, "ExtendedPropertyDescriptor must have extenderInfo");
            Debug.Assert(provider != null, "ExtendedPropertyDescriptor must have provider");

            ArrayList attrList = new ArrayList(AttributeArray);

            attrList.Add(ExtenderProvidedPropertyAttribute.Create(extenderInfo, receiverType, provider));
            if (extenderInfo.IsReadOnly)
            {
                attrList.Add(ReadOnlyAttribute.Yes);
            }

            Attribute[] temp = new Attribute[attrList.Count];
            attrList.CopyTo(temp, 0);
            AttributeArray = temp;

            _extenderInfo = extenderInfo;
            _provider     = provider;
        }