示例#1
0
 public DynamicObjectTypeDescriptor(ICustomTypeDescriptor parent, DynamicObjectType dt)
 {
     this._parent     = parent;
     this._dt         = dt;
     this._atts       = CreateAttributes(dt);
     this._properties = CreatePropertyDescriptorCollection(dt);
 }
示例#2
0
        public DynamicObjectType(string name, DynamicObjectType baseType = null, Type dataEntityType = null, DataEntityTypeFlag flag = 0, params object[] attributes)
        {
            this._flag     = flag;
            this._baseType = baseType;

            this._attributes = attributes;
            this.ClrType     = dataEntityType;
        }
示例#3
0
 private static AttributeCollection CreateAttributes(DynamicObjectType dt)
 {
     object[] customAttributes = dt.GetCustomAttributes(true);
     if ((customAttributes == null) || (customAttributes.Length <= 0))
     {
         return(AttributeCollection.Empty);
     }
     Attribute[] attributes = new Attribute[customAttributes.Length];
     for (int i = 0; i < customAttributes.Length; i++)
     {
         attributes[i] = (Attribute)customAttributes[i];
     }
     return(new AttributeCollection(attributes));
 }
 internal DynamicPropertyCollection(IList <DynamicProperty> list, DynamicObjectType reflectedType)
     : base(list)
 {
     this._reflectedType = reflectedType;
     this.ResetPropertyIndex();
 }
示例#5
0
        private static PropertyDescriptorCollection CreatePropertyDescriptorCollection(DynamicObjectType dt)
        {
            DynamicPropertyCollection properties = dt.Properties;

            PropertyDescriptor[] descriptorArray = new PropertyDescriptor[properties.Count];
            for (int i = 0; i < properties.Count; i++)
            {
                descriptorArray[i] = properties[i].PropertyDescriptor;
            }
            return(new PropertyDescriptorCollection(descriptorArray));
        }
示例#6
0
 public DynamicObjectTypeDescriptor(DynamicObjectType dt)
     : this(null, dt)
 {
 }