Esempio n. 1
0
        /// <summary>
        /// Register a sub dataflow as child. Also make sure the dataflow will fail if the registered dataflow fails.
        /// </summary>
        public void RegisterChild(Dataflow childFlow, Action <Task> dataflowCompletionCallback = null, bool allowDuplicate = false)
        {
            if (childFlow == null)
            {
                throw new ArgumentNullException("childFlow");
            }

            if (childFlow.IsMyChild(this))
            {
                throw new ArgumentException(
                          string.Format("{0} Cannot register a child {1} who is already my ancestor", this.FullName, childFlow.FullName));
            }

            RegisterChild(new DataflowDependency(childFlow, this, DependencyKind.Internal, dataflowCompletionCallback), allowDuplicate);
        }