Beispiel #1
0
        private void RemoveFlow()
        {
            var listFlow = new List <RemoveFlowCommand>();

            foreach (SourceControl sourceControl in sources)
            {
                foreach (SourceItemControl inItem in sourceControl.InItems)
                {
                    if (inItem.CurrentItem.InConnection != null &&
                        sources.FirstOrDefault(s => s.CurrentSource == inItem.CurrentItem.InConnection.Target.Source) == null)
                    {
                        listFlow.Add(new RemoveFlowCommand(flowAreaControl, flowAreaControl.GetArrowControl(inItem)));
                    }
                }
                foreach (SourceItemControl outItem in sourceControl.OutItems)
                {
                    foreach (Connection connection in outItem.CurrentItem.OutConnections)
                    {
                        listFlow.Add(new RemoveFlowCommand(flowAreaControl, flowAreaControl.GetArrowControl(connection.Target)));
                    }
                }
            }
            removeFlowCommands = listFlow.ToArray();

            foreach (RemoveFlowCommand command in removeFlowCommands)
            {
                command.Execute();
            }
        }