private void DrawAction(Point point) { ActionTool actionTool = FlowManager.Instance.ActionTool; if (actionTool.SelectedAction != null) { Type actionType = actionTool.SelectedAction.GetType(); FlowComponent flowComponent = null; FWProcess fwProcess = null; if (actionType.Equals(typeof(ActionInputValue))) { fwProcess = new ActionInputValue(); } else if (actionType.Equals(typeof(ActionCodeInjection))) { fwProcess = new ActionCodeInjection(); } else if (actionType.Equals(typeof(ActionMessageBox))) { fwProcess = new ActionMessageBox(); } else if (actionType.Equals(typeof(ActionListBoxAdd))) { fwProcess = new ActionListBoxAdd(); } else if (actionType.Equals(typeof(ActionListBoxRemove))) { fwProcess = new ActionListBoxRemove(); } // 앞으로 추가. else if (false) { } if (fwProcess != null) { fwProcess.Left = Math.Round(point.X); fwProcess.Top = Math.Round(point.Y); fwProcess.Width = 100; fwProcess.Height = 30; if (!FWSymbolList.Contains(fwProcess)) { FWSymbolList.Add(fwProcess); } flowComponent = new FlowComponent(fwProcess, this); flowComponent.PropertyChanged += FlowComponent_PropertyChanged; flowComponent.PreviewMouseDown += FlowComponent_PreviewMouseDown; flowComponent.PreviewMouseUp += FlowComponent_PreviewMouseUp; canvasArea.Children.Add(flowComponent); FlowManager.Instance.ActionTool.DeselectListBox(); } } }
private void DrawSymbol(Type type, Point point) { FlowComponent flowComponent = null; FWSymbol fwSymbol = null; if (type.Equals(typeof(FWTerminal))) { fwSymbol = new FWTerminal(); } else if (type.Equals(typeof(FWReady))) { fwSymbol = new FWReady(); } else if (type.Equals(typeof(FWProcess))) { fwSymbol = new FWProcess(); } else if (type.Equals(typeof(FWDecision))) { fwSymbol = new FWDecision(); } if (fwSymbol != null) { fwSymbol.Left = Math.Round(point.X); fwSymbol.Top = Math.Round(point.Y); fwSymbol.Width = 100; fwSymbol.Height = 30; if (!FWSymbolList.Contains(fwSymbol)) { FWSymbolList.Add(fwSymbol); } flowComponent = new FlowComponent(fwSymbol, this); flowComponent.PropertyChanged += FlowComponent_PropertyChanged; flowComponent.PreviewMouseDown += FlowComponent_PreviewMouseDown; flowComponent.PreviewMouseUp += FlowComponent_PreviewMouseUp; canvasArea.Children.Add(flowComponent); FlowManager.Instance.FlowTool.Deselection(); } }