示例#1
0
 private void ProcessorNodes_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.NewItems != null)
     {
         foreach (ProcessorNode newNode in e.NewItems)
         {
             newNode.Owner            = this;
             newNode.Parent           = Owner;
             newNode.PropertyChanged += NodePropertyChanged;
         }
     }
     if (e.Action == NotifyCollectionChangedAction.Remove ||
         e.Action == NotifyCollectionChangedAction.Replace ||
         e.Action == NotifyCollectionChangedAction.Reset)
     {
         if (e.OldItems != null)
         {
             foreach (ProcessorNode oldNode in e.OldItems)
             {
                 oldNode.Owner            = null;
                 oldNode.Parent           = null;
                 oldNode.PropertyChanged -= NodePropertyChanged;
             }
         }
     }
     for (int i = 0; i < ProcessorNodes.Count; i++)
     {
         ProcessorNode node = ProcessorNodes[i];
         node.Index = i;
         if (i == 0 && node.InputFileSource == InputFileSource.PreviousOutput)
         {
             node.InputFileSource = InputFileSource.OriginalFile;
         }
     }
 }
示例#2
0
            public void Execute(object parameter)
            {
                ProcessorNode node = new ProcessorNode();

                node.Loaded = this.Node.Loaded;
                Node.ProcessorNodes.Add(node);
            }