public ObjectPropertyCollection(IObjectInstance objectInstance, ClassProperty classProperty) : base(objectInstance, classProperty) { if (ClassProperty.CanRead) { // When the collection is out of date, update it from the wrapped object. _depCollection = new Computed(OnUpdateCollection); // When the property becomes out of date, trigger an update. _depCollection.Invalidated += TriggerUpdate; } }
public ObjectPropertyCollection(IObjectInstance objectInstance, ClassProperty classProperty, bool hasChildObjects) : base(objectInstance, classProperty) { _hasChildObjects = hasChildObjects; if (ClassProperty.CanRead) { // Bind to the observable collection. ClassProperty.SetUserOutput(ObjectInstance, _collection); // When the collection is out of date, update it from the wrapped object. _depCollection = new Computed(OnUpdateCollection); } }
public ObjectPropertyAtom(IObjectInstance objectInstance, ClassProperty classProperty, bool hasChildObject) : base(objectInstance, classProperty) { _hasChildObject = hasChildObject; if (ClassProperty.CanRead) { // When the property is out of date, update it from the wrapped object. _depProperty = new Computed(delegate { object value = ClassProperty.GetObjectValue(ObjectInstance.WrappedObject); if (_hasChildObject) { IObjectInstance oldChild = _child; object oldValue = oldChild == null ? null : oldChild.WrappedObject; _child = null; IObjectInstance wrapper; if (value == null) wrapper = null; else if (value == oldValue) { wrapper = oldChild; _child = wrapper; } else { if (WrapObject(value, out wrapper)) _child = wrapper; } ClassProperty.SetUserOutput(ObjectInstance, wrapper); if (oldChild != _child && oldChild != null) { ObjectInstance.Tree.RemoveKey(oldValue); oldChild.Dispose(); } } else { ClassProperty.SetUserOutput(ObjectInstance, value); } }); } }
public ObjectPropertyAtom(IObjectInstance objectInstance, ClassProperty classProperty) : base(objectInstance, classProperty) { if (ClassProperty.CanRead) { // When the property is out of date, update it from the wrapped object. _depProperty = new Computed(delegate { object value = ClassProperty.GetObjectValue(ObjectInstance.WrappedObject); value = TranslateOutgoingValue(value); if (!Object.Equals(_value, value)) _value = value; if (_firePropertyChanged) ObjectInstance.FirePropertyChanged(ClassProperty.Name); _firePropertyChanged = true; }); // When the property becomes out of date, trigger an update. _depProperty.Invalidated += () => UpdateScheduler.ScheduleUpdate(UpdateNow); } }
public ObjectPropertyAtom(IObjectInstance objectInstance, ClassProperty classProperty) : base(objectInstance, classProperty) { if (ClassProperty.CanRead) { // When the property is out of date, update it from the wrapped object. _depProperty = new Computed(delegate { object value = ClassProperty.GetObjectValue(ObjectInstance.WrappedObject); value = TranslateOutgoingValue(value); if (!Object.Equals(_value, value)) { _value = value; } if (_firePropertyChanged) { ObjectInstance.FirePropertyChanged(ClassProperty.Name); } _firePropertyChanged = true; }); // When the property becomes out of date, trigger an update. _depProperty.Invalidated += () => UpdateScheduler.ScheduleUpdate(UpdateNow); } }
public ObjectPropertyCollectionNative(IObjectInstance objectInstance, ClassProperty classProperty) : base(objectInstance, classProperty) { }
public ObjectPropertyCollectionObject(IObjectInstance objectInstance, ClassProperty classProperty) : base(objectInstance, classProperty) { }
public ObjectPropertyAtomNative(IObjectInstance objectInstance, ClassProperty classProperty) : base(objectInstance, classProperty) { }
public static ObjectProperty From(IObjectInstance objectInstance, ClassProperty classProperty) { return classProperty.MakeObjectProperty(objectInstance); }
public ObjectProperty(IObjectInstance objectInstance, ClassProperty classProperty) { ObjectInstance = objectInstance; ClassProperty = classProperty; }
public static ObjectProperty From(IObjectInstance objectInstance, ClassProperty classProperty) { return(classProperty.MakeObjectProperty(objectInstance)); }