Example #1
0
        private void AddOrReplaceConnection()
        {
            if (DesignMode)
            {
                var connection = new Connection(SelectionService.Input, SelectionService.Output);
                var selector   =
                    CurrentProject.Connections.FirstOrDefault(
                        x => x.FromInputOutput.InputOutput == connection.FromInputOutput.InputOutput);
                if (selector != null)
                {
                    CurrentProject.RemoveConnection(selector);
                }

                CurrentProject.AddConnection(connection);
            }
        }
Example #2
0
        private void SelectionServiceOnInComplete(object sender, EventArgs eventArgs)
        {
            if (DesignMode)
            {
                var selected = SelectionService.SelectedInputOutput;
                if (selected != null)
                {
                    var selector =
                        CurrentProject.Connections.FirstOrDefault(
                            x =>
                            x.FromInputOutput.InputOutput == selected.InputOutput ||
                            x.ToInputOutput.InputOutput == selected.InputOutput);

                    //Kontextmenü Injecten

                    if (selector != null)
                    {
                        CurrentProject.RemoveConnection(selector);
                    }
                }
            }
        }