public static void RegisterAlgNode(this AbstractAlgorithmNode n) { if (!_algNodes.ContainsKey(n.GetType())) { _algNodes.Add(n.GetType(), _tableFactory.MakeKeyTable <IAlgorithmNode>()); } _algNodes[n.GetType()].Add(n.ID, n); }
public static IEnumerable <TAlg> GetAllNodes <TAlg>(this AbstractAlgorithmNode n) where TAlg : class, IAlgorithmNode { if (!_algNodes.ContainsKey(n.GetType())) { _algNodes.Add(n.GetType(), _tableFactory.MakeKeyTable <IAlgorithmNode>()); } return(_algNodes[n.GetType()].Select <IAlgorithmNode, TAlg>(alg => alg as TAlg)); }
public static TAlg GetAlgNode <TAlg>(this AbstractAlgorithmNode n, UUID id) where TAlg : class, IAlgorithmNode { return(_algNodes[n.GetType()][id] as TAlg); }