コード例 #1
0
 /// <summary>
 /// Event raised then Connections have been removed.
 /// </summary>
 private void connections_ItemsRemoved(object sender, CollectionItemsChangedEventArgs e)
 {
     foreach (ConnectionViewModel connection in e.Items)
     {
         connection.SourceConnector = null;
         connection.DestConnector = null;
     }
 }
コード例 #2
0
        /// <summary>
        /// Event raised when connections have been removed from the connector.
        /// </summary>
        private void attachedConnections_ItemsRemoved(object sender, CollectionItemsChangedEventArgs e)
        {
            foreach (ConnectionViewModel connection in e.Items)
            {
                connection.ConnectionChanged -= new EventHandler<EventArgs>(connection_ConnectionChanged);
            }

            if (AttachedConnections.Count == 0)
            {
                //
                // No longer connected to anything, notify the data-binding system that
                // 'IsConnected' should be re-evaluated.
                //
                OnPropertyChanged("IsConnectionAttached");
                OnPropertyChanged("IsConnected");
            }
        }
コード例 #3
0
        /// <summary>
        /// Debug checking to ensure that no connection is added to the list twice.
        /// </summary>
        private void attachedConnections_ItemsAdded(object sender, CollectionItemsChangedEventArgs e)
        {
            foreach (ConnectionViewModel connection in e.Items)
            {
                connection.ConnectionChanged += new EventHandler<EventArgs>(connection_ConnectionChanged);
            }

            if ((AttachedConnections.Count - e.Items.Count) == 0)
            {
                //
                // The first connection has been added, notify the data-binding system that
                // 'IsConnected' should be re-evaluated.
                //
                OnPropertyChanged("IsConnectionAttached");
                OnPropertyChanged("IsConnected");
            }
        }
コード例 #4
0
 /// <summary>
 /// Event raised when connectors are removed from the node.
 /// </summary>
 private void outputConnectors_ItemsRemoved(object sender, CollectionItemsChangedEventArgs e)
 {
     foreach (ConnectorViewModel connector in e.Items)
     {
         connector.ParentNode = null;
         connector.Type = ConnectorType.Undefined;
     }
 }
コード例 #5
0
 /// <summary>
 /// Event raised when connectors are added to the node.
 /// </summary>
 private void outputConnectors_ItemsAdded(object sender, CollectionItemsChangedEventArgs e)
 {
     foreach (ConnectorViewModel connector in e.Items)
     {
         connector.ParentNode = this;
         connector.Type = ConnectorType.Output;
     }
 }
コード例 #6
0
ファイル: Block.cs プロジェクト: Martovskij/GraphViewer
 /// <summary>
 /// Event raised when connectors are removed from the node.
 /// </summary>
 private void connectors_ItemsRemoved(object sender, CollectionItemsChangedEventArgs e)
 {
     foreach (ConnectorViewModel connector in e.Items)
     {
         connector.ParentNode = null;
     }
 }
コード例 #7
0
ファイル: NodeViewModel.cs プロジェクト: xcasadio/FlowGraph
 /// <summary>
 /// Event raised when connectors are added to the node.
 /// </summary>
 private void allConnectors_ItemsAdded(object sender, CollectionItemsChangedEventArgs e)
 {
     foreach (ConnectorViewModel connector in e.Items)
     {
         connector.ParentNode = this;
     }
 }