public PropertyViewModel(IGenericProperty <TProperty> property, IEqualityComparer <TProperty> equalityComparer, IPropertyConverter <TProperty> converter) { _property = property; _equalityComparer = equalityComparer; _converter = converter; _objectProperty = _property.Value; Validate(); }
public virtual void RemoveProperty(IGenericProperty gp) { int i = List.IndexOf(gp); if (i != -1) { List.RemoveAt(i); } }
public GenericPropertyDescriptor(IGenericProperty Property /*, DPropertyTab owner*/) : base(Property.PropertyName, (Attribute[]) AddIfCondition( ConcatArrayList( new Attribute[] { new CategoryAttribute(Property.Category), RefreshPropertiesAttribute.All, new DescriptionAttribute(Property.Description) } , Property.Attributes) , Property.Value is IGenericPropertyCollection, new TypeConverterAttribute(typeof(DExpandableObjectConverter)) ).ToArray(typeof(Attribute))) { this.Property = Property; //this.owner = owner; }
private IPropertyViewModel GetViewModel <TProperty>(IGenericProperty <TProperty> property) { if (property.Type == typeof(bool)) { return(new PropertyViewModel <bool>((IGenericProperty <bool>)property, EqualityComparer <bool> .Default, new BoolPropertyConverter())); } if (property.Type == typeof(float)) { return(new PropertyViewModel <float>((IGenericProperty <float>)property, EqualityComparer <float> .Default, new FloatPropertyConverter())); } if (property.Type == typeof(string)) { if (property.Configuration.IsDirectoryPath) { return(new ReadonlyDirectoryPathViewModel((IGenericProperty <string>)property, _directoryPicker, EqualityComparer <string> .Default, new StringPropertyConverter())); } return(new PropertyViewModel <string>((IGenericProperty <string>)property, EqualityComparer <string> .Default, new StringPropertyConverter())); } if (property.Type == typeof(int)) { return(new PropertyViewModel <int>((IGenericProperty <int>)property, EqualityComparer <int> .Default, new IntPropertyConverter())); } if (property.Type == typeof(uint)) { return(new PropertyViewModel <uint>((IGenericProperty <uint>)property, EqualityComparer <uint> .Default, new UintPropertyConverter())); } if (property.Type == typeof(ushort)) { return(new PropertyViewModel <ushort>((IGenericProperty <ushort>)property, EqualityComparer <ushort> .Default, new UshortPropertyConverter())); } return(property.Type.IsEnum ? CreateEnumViewModel(property) : null); }
public ReadonlyDirectoryPathViewModel(IGenericProperty <string> property, IDirectoryPicker directoryPicker, IEqualityComparer <string> equalityComparer, IPropertyConverter <string> converter) : base(property, equalityComparer, converter) { _property = property; _directoryPicker = directoryPicker; }
public GenericPropertyDescriptor(IGenericProperty Property/*, DPropertyTab owner*/ ) : base(Property.PropertyName, (Attribute[]) AddIfCondition( ConcatArrayList( new Attribute[] { new CategoryAttribute(Property.Category), RefreshPropertiesAttribute.All, new DescriptionAttribute(Property.Description) } ,Property.Attributes) , Property.Value is IGenericPropertyCollection, new TypeConverterAttribute(typeof(DExpandableObjectConverter)) ).ToArray(typeof(Attribute))) { this.Property = Property; //this.owner = owner; }
public virtual void RemoveProperty( IGenericProperty gp ) { int i = List.IndexOf( gp ); if( i != -1 ) List.RemoveAt( i ); }
public virtual void PropertyChanged( IGenericProperty prop ) { }
public virtual void AddProperty( IGenericProperty gp ) { List.Add( gp ); gp.PropertyParent = this; }
private static IPropertyViewModel CreateEnumViewModel <TEnum>(IGenericProperty <TEnum> property) { return(new PropertyViewModel <TEnum>(property, EqualityComparer <TEnum> .Default, new EnumPropertyConverter <TEnum>())); }
public virtual void PropertyChanged(IGenericProperty prop) { }
public virtual void AddProperty(IGenericProperty gp) { List.Add(gp); gp.PropertyParent = this; }