internal Property(IUndoRedoService undoRedoService, INotifyPropertyChanged propertyOwnerObj, PropertyInfo propertyInfo, RecordedElement initialPropertyValue, IsRecordableAttribute isRecordableAttribute) { if (undoRedoService == null) { throw new ArgumentNullException("undoRedoService"); } if (propertyOwnerObj == null) { throw new ArgumentNullException("propertyOwnerObj"); } if (propertyInfo == null) { throw new ArgumentNullException("propertyInfo"); } if (initialPropertyValue == null) { throw new ArgumentNullException("initialPropertyValue"); } if (isRecordableAttribute == null) { throw new ArgumentNullException("isRecordableAttribute"); } _undoRedoService = undoRedoService; _propertyOwnerObj = propertyOwnerObj; _propertyInfo = propertyInfo; _value = initialPropertyValue; _isRecordableAttribute = isRecordableAttribute; }
public void Stop() { if (_recordedElement != null) { _recordedElement.Release(); _recordedElement = null; } }
internal virtual void Release() { if (_value != null) { _value.Release(); _value = null; } }
public void Record(IUndoRedoService undoRedoService, object objToRecord) { if (undoRedoService == null) { throw new ArgumentNullException("undoRedoService"); } if (objToRecord == null) { throw new ArgumentNullException("objToRecord"); } this.UndoRedoService = undoRedoService; _recordedElement = RecordedElementFactory.Create(undoRedoService, objToRecord); }
internal EveryChangeRecordProperty(IUndoRedoService undoRedoService, INotifyPropertyChanged propertyOwnerObj, PropertyInfo propertyInfo, RecordedElement initialPropertyValue, IsRecordableAttribute isRecordableAttribute) : base(undoRedoService, propertyOwnerObj, propertyInfo, initialPropertyValue, isRecordableAttribute) { }
internal void UpdateValue() { var oldValue = this.Value.OldValue; var newPropertyValue = _propertyInfo.GetValue(_propertyOwnerObj, null); if (!_undoRedoService.IsUndoing && !_undoRedoService.IsRedoing) { RecordValueChange(newPropertyValue, oldValue); } this.Value = RecordedElementFactory.Create(_undoRedoService, _propertyInfo.GetValue(_propertyOwnerObj, null)); }
internal virtual void Release() { if (_value != null) { _value.Release(); _value = null; } }
internal Property(IUndoRedoService undoRedoService, INotifyPropertyChanged propertyOwnerObj, PropertyInfo propertyInfo, RecordedElement initialPropertyValue, IsRecordableAttribute isRecordableAttribute) { if (undoRedoService == null) { throw new ArgumentNullException("undoRedoService"); } if (propertyOwnerObj == null) { throw new ArgumentNullException("propertyOwnerObj"); } if (propertyInfo == null) { throw new ArgumentNullException("propertyInfo"); } if (initialPropertyValue == null) { throw new ArgumentNullException("initialPropertyValue"); } if (isRecordableAttribute == null) { throw new ArgumentNullException("isRecordableAttribute"); } _undoRedoService = undoRedoService; _propertyOwnerObj = propertyOwnerObj; _propertyInfo = propertyInfo; _value = initialPropertyValue; _isRecordableAttribute = isRecordableAttribute; }
internal FilteredChangeRecordProperty(IUndoRedoService undoRedoService, INotifyPropertyChanged propertyOwnerObj, PropertyInfo propertyInfo, RecordedElement initialPropertyValue, IsRecordableWithFilterAttribute isRecordableWithFilterAttribute) : base(undoRedoService, propertyOwnerObj, propertyInfo, initialPropertyValue, isRecordableWithFilterAttribute) { _undoRedoDelayedExecutedRevertibleCommandAppender = new UndoRedoDelayedExecutedRevertibleCommandAppender<object>(undoRedoService, _propertyOwnerObj, propertyInfo) { DelayMs = isRecordableWithFilterAttribute.FilterTimeMs, CommandDescription = _isRecordableAttribute.Description, }; }
internal FilteredChangeRecordProperty(IUndoRedoService undoRedoService, INotifyPropertyChanged propertyOwnerObj, PropertyInfo propertyInfo, RecordedElement initialPropertyValue, IsRecordableWithFilterAttribute isRecordableWithFilterAttribute) : base(undoRedoService, propertyOwnerObj, propertyInfo, initialPropertyValue, isRecordableWithFilterAttribute) { _undoRedoDelayedExecutedRevertibleCommandAppender = new UndoRedoDelayedExecutedRevertibleCommandAppender <object>(undoRedoService, _propertyOwnerObj, propertyInfo) { DelayMs = isRecordableWithFilterAttribute.FilterTimeMs, CommandDescription = _isRecordableAttribute.Description, }; }
internal EveryChangeRecordProperty(IUndoRedoService undoRedoService, INotifyPropertyChanged propertyOwnerObj, PropertyInfo propertyInfo, RecordedElement initialPropertyValue, IsRecordableAttribute isRecordableAttribute) : base(undoRedoService, propertyOwnerObj, propertyInfo, initialPropertyValue, isRecordableAttribute) { }