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