public ArrayItemProperty(VLTCollection collection, VLTClassField field, VLTArrayType array, VLTBaseType item) : base(array.GetType(), $"[{Array.IndexOf(array.Items, item)}]", array.ItemType) { _collection = collection; _field = field; _array = array; _item = item; }
public PropertyDescriptorCollection GetProperties() { PropertyDescriptorCollection pdc = new PropertyDescriptorCollection(new PropertyDescriptor[0]); pdc.Add(new CollectionVaultProperty(_collection)); foreach (var dataPair in _collection.DataRow) { VLTClassField classField = _collection.Class.Fields[dataPair.Key]; //EditorSchemaField schemaField = null; //if (_schema != null) // schemaField = _schema.Fields.Find(f => f.FieldName == classField.Name); var fieldProxy = new VLTFieldProxy(/*schemaField,*/ _collection, classField); pdc.Add(fieldProxy); } return(pdc); }
public VLTFieldProxy(/*EditorSchemaField schemaField, */ VLTCollection collection, VLTClassField classField) : base( classField.Name, null) { //_schemaField = schemaField; _collection = collection; _classField = classField; _value = _collection.DataRow[classField.Key]; object effectiveValue = GetEffectiveValue(); Debug.Assert(effectiveValue != null); if (_classField.IsArray) { PropertyType = ((VLTArrayType)_value).ItemType.MakeArrayType(); } else { PropertyType = effectiveValue.GetType(); } //PropertyType = effectiveValue.GetType(); }
//private readonly EditorSchemaField _schemaField; public StaticFieldProxy(VLTClass vltClass, VLTClassField vltClassField /*, EditorSchemaField schemaField*/) : base(vltClassField.Name, null) { _vltClass = vltClass; _vltClassField = vltClassField; //_schemaField = schemaField; }