Пример #1
0
        protected static DerrivedProperty <TObj, TVal> RegisterProperty <TObj, TVal>(Expression <Func <TObj, TVal> > property, Func <TObj, TVal> defaultDelegate, IEnumerable <Property> dependentProperties) where TObj : GraphObject
        {
            var graphProperty = new DerrivedProperty <TObj, TVal>(property, defaultDelegate, dependentProperties);

            propertyRegister.RegisterProperty <TObj>(graphProperty);
            return(graphProperty);
        }
Пример #2
0
        public Func <TObj, TVal> GetValue <TObj, TVal>(DerrivedProperty <TObj, TVal> property, Node node, int minDepth = 1) where TObj : GraphObject
        {
            var result = Get(property, node, minDepth);

            if (null != result)
            {
                return((Func <TObj, TVal>)result);
            }
            else
            {
                return(property.Default);
            }
        }
Пример #3
0
 public Func <TObj, TVal> GetValue <TObj, TVal>(DerrivedProperty <TObj, TVal> property, int minDepth) where TObj : GraphObject
 {
     return(GetValue(property, graph.CurrentNode, minDepth));
 }
Пример #4
0
 public void SetValue <TObj, TVal>(DerrivedProperty <TObj, TVal> property, Node node, Func <TObj, TVal> func) where TObj : GraphObject
 {
     Set(property, node, func);
 }
Пример #5
0
        public void SetValue <TObj, TVal>(DerrivedProperty <TObj, TVal> property, TVal value) where TObj : GraphObject
        {
            Func <TObj, TVal> func = o => value;

            Set(property, graph.CurrentNode, func);
        }