Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
 public Func <TObj, TVal> GetValue <TObj, TVal>(DerrivedProperty <TObj, TVal> property, int minDepth) where TObj : GraphObject
 {
     return(GetValue(property, graph.CurrentNode, minDepth));
 }
Exemplo n.º 4
0
 public void SetValue <TObj, TVal>(DerrivedProperty <TObj, TVal> property, Node node, Func <TObj, TVal> func) where TObj : GraphObject
 {
     Set(property, node, func);
 }
Exemplo n.º 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);
        }