public void RemoveConnectorEditor()
 {
     if (connectorEditor != null)
     {
         connectorEditor.Remove();
         connectorEditor = null;
     }
 }
Esempio n. 2
0
 public EditPointAdorner(ConnectorEditor cEditor, UIElement adornedElement, bool shouldDrawLines)
     : base(adornedElement)
 {
     Fx.Assert(adornedElement != null, "Adorned element is null.");
     adornedEditor         = cEditor;
     this.IsHitTestVisible = false;
     this.drawLines        = shouldDrawLines;
 }
        public FreeFormPanel()
        {
            connectorEditor = null;
            this.autoConnectHelper = new AutoConnectHelper(this);
            lastYPosition = FreeFormPanel.TopStackingMargin;

            this.Unloaded += (sender, e) =>
            {
                this.RemoveConnectorEditor();
            };
        }
        public FreeFormPanel()
        {
            connectorEditor        = null;
            this.autoConnectHelper = new AutoConnectHelper(this);
            lastYPosition          = FreeFormPanel.TopStackingMargin;

            this.Unloaded += (sender, e) =>
            {
                this.RemoveConnectorEditor();
            };
        }
 void CreateNewConnectorEditor(MouseButtonEventArgs e)
 {
     if (connectorEditor == null || !e.Source.Equals(connectorEditor.Connector))
     {
         //If user clicks anywhere other than the connector editor, destroy it.
         RemoveConnectorEditor();
         if (typeof(Connector).IsAssignableFrom(e.Source.GetType()))
         {
             this.connectorEditor = new ConnectorEditor(this, e.Source as Connector);
         }
     }
 }
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e != null && !this.Disabled && this.IsOutmostPanel())
            {
                if (connectorEditor != null && connectorEditor.BeingEdited)
                {
                    if (e.Key == Key.Escape)
                    {
                        //If escape key is hit while dragging a connector, end dragging.

                        Connector affectedConnector = connectorEditor.Connector;
                        RemoveConnectorEditor();
                        this.connectorEditor = new ConnectorEditor(this, affectedConnector);
                    }

                    // Ignore all other Keyboard input when rerouting connector
                    e.Handled = true;
                }
            }

            base.OnKeyDown(e);
        }
 public EditPointAdorner(ConnectorEditor cEditor, UIElement adornedElement, bool shouldDrawLines)
     : base(adornedElement)
 {
     Fx.Assert(adornedElement != null, "Adorned element is null.");
     adornedEditor = cEditor;
     this.IsHitTestVisible = false;
     this.drawLines = shouldDrawLines;
 }
 void CreateNewConnectorEditor(MouseButtonEventArgs e)
 {
     if (connectorEditor == null || !e.Source.Equals(connectorEditor.Connector))
     {
         //If user clicks anywhere other than the connector editor, destroy it.
         RemoveConnectorEditor();
         if (typeof(Connector).IsAssignableFrom(e.Source.GetType()))
         {
             this.connectorEditor = new ConnectorEditor(this, e.Source as Connector);
         }
     }
 }
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e != null && !this.Disabled && this.IsOutmostPanel())
            {
                if (connectorEditor != null && connectorEditor.BeingEdited)
                {
                    if (e.Key == Key.Escape)
                    {
                        //If escape key is hit while dragging a connector, end dragging.

                        Connector affectedConnector = connectorEditor.Connector;
                        RemoveConnectorEditor();
                        this.connectorEditor = new ConnectorEditor(this, affectedConnector);
                    }

                    // Ignore all other Keyboard input when rerouting connector
                    e.Handled = true;
                }
            }

            base.OnKeyDown(e);
        }
        public void RemoveConnectorEditor()
        {
            if (connectorEditor != null)
            {
                connectorEditor.Remove();
                connectorEditor = null;
            }

        }