public DynamicObjectTypeDescriptor(ICustomTypeDescriptor parent, DynamicObjectType dt) { this._parent = parent; this._dt = dt; this._atts = CreateAttributes(dt); this._properties = CreatePropertyDescriptorCollection(dt); }
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; }
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(); }
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)); }
public DynamicObjectTypeDescriptor(DynamicObjectType dt) : this(null, dt) { }