private void ProjectPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "LogicalCircuit")
     {
         if (this.current != null)
         {
             this.current.NotifyCurrentChanged();
         }
         if (!this.logicalCircuitDescriptors.TryGetValue(this.circuitProject.ProjectSet.Project.LogicalCircuit, out this.current))
         {
             this.current = null;
         }
         if (this.current != null)
         {
             this.current.NotifyCurrentChanged();
         }
     }
 }
Exemplo n.º 2
0
 public void DescriptorMouseDown(FrameworkElement sender, MouseButtonEventArgs e)
 {
     if (e.ChangedButton == MouseButton.Left && this.InEditMode)
     {
         IDescriptor descriptor = sender.DataContext as IDescriptor;
         if (descriptor != null)
         {
             if (1 < e.ClickCount)
             {
                 LogicalCircuitDescriptor logicalCircuitDescriptor = descriptor as LogicalCircuitDescriptor;
                 if (logicalCircuitDescriptor != null && !logicalCircuitDescriptor.IsCurrent)
                 {
                     this.OpenLogicalCircuit(logicalCircuitDescriptor.Circuit);
                 }
             }
             else
             {
                 this.dragStart  = e.GetPosition(sender);
                 this.dragSource = sender;
             }
         }
     }
 }