public ProfileCollectionPropertyViewModel(IProfileProperty profileProperty) { Name = profileProperty.PropertyName; Type = profileProperty.PropertyType; values = CreateObservableCollection(profileProperty); }
internal ProfilePropertyWindow(Window parentWindow, IProfileProperty profileProperty) : base(parentWindow) { InitializeComponent(); ProfileProperty = new PropertyViewModel(profileProperty.PropertyName, profileProperty.PropertyType, profileProperty.PropertyValue); }
public void AddProperty(IProfileProperty prop) { if (!properties.ContainsKey(prop.Name)) { properties.Add(prop.Name, prop); } }
public void SetUp() { profileProperty = Substitute.For <IProfileProperty>(); profileProperty.PropertyName.Returns("Foo"); profileProperty.PropertyType.Returns(typeof(string[])); profileProperty.PropertyValue = new[] { "Wibble", "Wobble" }; profileCollectionProperty = new ProfileCollectionPropertyViewModel(profileProperty); ((ObservableCollection <IProfileProperty>)profileCollectionProperty.Values)[0].PropertyValue = "Dibble"; }
internal ProfileCollectionPropertyWindow(Window parentWindow, IProfileProperty profileProperty) : base(parentWindow) { this.profileProperty = profileProperty; InitializeComponent(); ProfileCollectionProperty = new ProfileCollectionPropertyViewModel(profileProperty); }
public void Should_expose_all_the_data(Type dataType, bool isSupported) { profileProperty = Substitute.For <IProfileProperty>(); profileProperty.PropertyType.Returns(Array.CreateInstance(dataType, 0).GetType()); profileCollectionProperty = new ProfileCollectionPropertyViewModel(profileProperty); profileCollectionProperty.IsSupportedDataType.Should().Be(isSupported); }
public static IObjectProperty Create(IProfileProperty from, IProfileProperty to, object value) { var prop = new ObjectProperty(); prop.from = from; prop.to = to; prop.value = value; return(prop); }
public static PropertyMapItem Create(string name, IProfileProperty from, IProfileProperty to) { var map = new PropertyMapItem(); map.name = name; map.to = to; map.from = from; return(map); }
private ObservableCollection <IProfileProperty> CreateObservableCollection(IProfileProperty profileProperty) { if (profileProperty.PropertyValue == null) { return(new ObservableCollection <IProfileProperty>()); } var v = (Array)profileProperty.PropertyValue; return(new ObservableCollection <IProfileProperty>(v.Cast <object>().Select(x => new InstanceProfileProperty(x)))); }
private static bool IsNumber(IProfileProperty value) { if (value.PropertyType == typeof(sbyte)) { return(true); } if (value.PropertyType == typeof(byte)) { return(true); } if (value.PropertyType == typeof(short)) { return(true); } if (value.PropertyType == typeof(ushort)) { return(true); } if (value.PropertyType == typeof(int)) { return(true); } if (value.PropertyType == typeof(uint)) { return(true); } if (value.PropertyType == typeof(long)) { return(true); } if (value.PropertyType == typeof(ulong)) { return(true); } if (value.PropertyType == typeof(float)) { return(true); } if (value.PropertyType == typeof(double)) { return(true); } if (value.PropertyType == typeof(decimal)) { return(true); } return(false); }
private bool IsSupportedEnumerable(IProfileProperty profileProperty) { return(profileProperty.PropertyType.IsArray); }
public void RemoveItem(IProfileProperty item) { values.Remove(item); }