public bool TryGetValue(PtpmItemProperty sourceItem, out object value) { if (ActionGetValueOf != null) { return(ActionGetValueOf(sourceItem, out value)); } value = null; return(false); }
private static void MovePropertyToProperty(PtpmItemProperty source, PtpmItemProperty destination, IEnumerable <IPtpmMover> movers) { var _valueToMove = source.PropertyValue; var _ptpmMovers = movers as IPtpmMover[] ?? movers.ToArray(); foreach (var _move in _ptpmMovers) { if (_move.TryGetValue(source, out object _newValue)) { _valueToMove = _newValue; } } if (_ptpmMovers.Any(move => move.TrySetValue(destination, _valueToMove))) { return; } destination.PropertyValue = _valueToMove; }
public bool TrySetValue(PtpmItemProperty destinationItem, object value) { return(ActionSetValueTo != null && ActionSetValueTo(destinationItem, value)); }
public PtpmItem(object property1, string property1Key, object property2, string property2Key) { Property1 = new PtpmItemProperty(property1Key, property1); Property2 = new PtpmItemProperty(property2Key, property2); }