コード例 #1
0
ファイル: DesignerCanvas.cs プロジェクト: kosmakoff/MiniETL
        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;
        }
コード例 #2
0
ファイル: DesignerCanvas.cs プロジェクト: kosmakoff/MiniETL
        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;
        }