Esempio n. 1
0
        public void ResetPartialConnection()
        {
            if (_partialConnection != null)
            {
                var diagram = _partialConnection.SourceConnectorInfo.DesignerItem.Diagram;
                diagram.RemoveItemCommand.Execute(_partialConnection);
            }

            _partialConnection = null;

            if (SourceConnector != null)
                SourceConnector.IsBuildingConnection = false;

            if (SinkConnector != null)
                SinkConnector.IsBuildingConnection = false;

            SourceConnector = null;
            SinkConnector = null;
        }
Esempio n. 2
0
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            //if (IsMouseCaptured)
            //	ReleaseMouseCapture();

            if (SourceConnector != null)
                SourceConnector.IsBuildingConnection = false;

            if (SinkConnector != null)
                SinkConnector.IsBuildingConnection = false;

            //if (SourceConnector != null && SinkConnector != null && SinkConnector.ConnectorInfo.CanEndConnection)
            //{
            //	var fullyCreatedSourceInfo = SourceConnector.ConnectorInfo;

            //	var diagram = fullyCreatedSourceInfo.DesignerItem.Diagram;

            //	var newConnection = new ConnectionViewModel(fullyCreatedSourceInfo.DesignerItem.Diagram,
            //		SourceConnector.ConnectorInfo, SinkConnector.ConnectorInfo);

            //	diagram.AddItemCommand.Execute(newConnection);
            //}

            if (SourceConnector != null && _partialConnection != null)
            {
                var sourceConnectorInfo = (FullyCreatedConnectorInfo) SourceConnector.DataContext;
                sourceConnectorInfo.DesignerItem.Diagram.RemoveItemCommand.Execute(_partialConnection);
            }

            _partialConnection = null;
            SourceConnector = null;
            SinkConnector = null;
        }