Beispiel #1
0
        public ActionListBoxRemoveWindow(FWProcess fwProcess)
        {
            InitializeComponent();

            this.DataContext = fwProcess;

            List <FWControl> fwControls = UIManager.Instance.FlowerUIDesigner.FWControlList;

            foreach (FWControl fwControl in fwControls)
            {
                if (fwControl is FWListBox fwListBox)
                {
                    cboxListBoxName.Items.Add(fwListBox.Name);
                }
                cboxType.Items.Add(fwControl);
            }

            List <FWSymbol> fwSymbols = FlowerManager.Instance.FWSymbols;

            foreach (FWSymbol fwSymbol in fwSymbols)
            {
                if (fwSymbol is FWReady fwReady)
                {
                    cboxType.Items.Add(fwReady);
                }
            }
        }
        public ActionInputValueWindow(FWProcess fwProcess)
        {
            InitializeComponent();

            this.DataContext = fwProcess;

            List <FWControl> fwControls = FlowerManager.Instance.FWControls;

            foreach (FWControl fwControl in fwControls)
            {
                cboxVarName.Items.Add(fwControl.Name);
                cboxType.Items.Add(fwControl);
            }

            List <FWSymbol> fwSymbols = FlowerManager.Instance.FWSymbols;

            foreach (FWSymbol fwSymbol in fwSymbols)
            {
                if (fwSymbol is FWReady fwReady)
                {
                    cboxVarName.Items.Add(fwReady.VarName);
                    cboxType.Items.Add(fwSymbol);
                }
            }
        }
Beispiel #3
0
        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 ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (sender is ListBox listBox)
            {
                SelectedAction = listBox.SelectedItem as FWProcess;

                FlowManager.Instance.FlowTool.Deselection();
            }
        }
Beispiel #5
0
        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();
            }
        }
 public void DeselectListBox()
 {
     lboxAction.SelectedIndex = -1;
     SelectedAction           = null;
 }