コード例 #1
0
        /// <summary>
        /// Constructor used for to make a blueprint of a DependencyGraph.
        /// Use this constructor when specifying arguments for a DependencyGraph constructor.
        /// </summary>
        /// <param name="objMyObject">Object associated with the current node</param>
        /// <param name="funcDependancyCondition">Function that must return true at the time of collecting dependencies in order for the dependency to register.</param>
        /// <param name="lstDownStreamNodes">Any objects that depend on the object associated with the current node</param>
        public DependencyGraphNode(T objMyObject, Func <T2, bool> funcDependancyCondition, params DependencyGraphNode <T, T2>[] lstDownStreamNodes)
        {
            MyObject = objMyObject;

            foreach (DependencyGraphNode <T, T2> objDownStreamNode in lstDownStreamNodes)
            {
                objDownStreamNode.UpStreamNodes.Add(new DependencyGraphNodeWithCondition <T, T2>(this, funcDependancyCondition));
                DownStreamNodes.Add(new DependencyGraphNodeWithCondition <T, T2>(objDownStreamNode, funcDependancyCondition));
            }
        }
コード例 #2
0
        /// <summary>
        /// Constructor used for to make a blueprint of a DependencyGraph.
        /// Use this constructor when specifying arguments for a DependencyGraph constructor.
        /// </summary>
        /// <param name="objMyObject">Object associated with the current node</param>
        /// <param name="lstDownStreamNodes">Any objects that depend on the object associated with the current node</param>
        public DependencyGraphNode(T objMyObject, params DependencyGraphNode <T, T2>[] lstDownStreamNodes)
        {
            MyObject = objMyObject;

            foreach (DependencyGraphNode <T, T2> objDownStreamNode in lstDownStreamNodes)
            {
                objDownStreamNode.UpStreamNodes.Add(new DependencyGraphNodeWithCondition <T, T2>(this, null));
                DownStreamNodes.Add(new DependencyGraphNodeWithCondition <T, T2>(objDownStreamNode, null));
            }
        }