示例#1
0
        public bool TryGetValue(PtpmItemProperty sourceItem, out object value)
        {
            if (ActionGetValueOf != null)
            {
                return(ActionGetValueOf(sourceItem, out value));
            }

            value = null;

            return(false);
        }
示例#2
0
        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;
        }
示例#3
0
 public bool TrySetValue(PtpmItemProperty destinationItem, object value)
 {
     return(ActionSetValueTo != null && ActionSetValueTo(destinationItem, value));
 }
示例#4
0
 public PtpmItem(object property1, string property1Key, object property2, string property2Key)
 {
     Property1 = new PtpmItemProperty(property1Key, property1);
     Property2 = new PtpmItemProperty(property2Key, property2);
 }