Example #1
0
        public void AddBranch()
        {
            CreateBranchWindowVM vm     = new CreateBranchWindowVM(this);
            CreateBranchWindow   window = new CreateBranchWindow(vm);

            window.Owner = Application.Current.MainWindow;
            if (window.ShowDialog() == true)
            {
                InsertIfThenElseConstruct(vm.IfThenElse);
            }
        }
Example #2
0
        public bool EditBranchExternal(IfThenElseVM ifThenElse, Window ownerWindow)
        {
            CreateBranchWindowVM vm     = new CreateBranchWindowVM(this, (IfThenElse)ifThenElse.Model);
            CreateBranchWindow   window = new CreateBranchWindow(vm);

            window.Owner = Application.Current.MainWindow;
            if (window.ShowDialog() == true && vm.IfThenElse != null)
            {
                IfThenElseVM newIfThenElse = new IfThenElseVM(vm.IfThenElse);
                ReplaceIfThenElse(ifThenElse, newIfThenElse);
                UpdateModel(true);
                SelectedConstructItem = newIfThenElse;
                return(true);
            }

            return(false);
        }
        public bool EditBranchExternal(IfThenElseVM ifThenElse, Window ownerWindow)
        {
            CreateBranchWindowVM vm = new CreateBranchWindowVM(this, (IfThenElse)ifThenElse.Model);
            CreateBranchWindow window = new CreateBranchWindow(vm);
            window.Owner = Application.Current.MainWindow;
            if (window.ShowDialog() == true && vm.IfThenElse != null)
            {
                IfThenElseVM newIfThenElse = new IfThenElseVM(vm.IfThenElse);
                InitConstruct(newIfThenElse);
                newIfThenElse.ThenConstructs = ThenConstructs;
                int index = constructs.IndexOf(ifThenElse);
                constructs.RemoveAt(index);
                constructs.Insert(index, newIfThenElse);
                UpdateModel(true);
                SelectedConstructItem = newIfThenElse;
                return true;
            }

            return false;
        }
 public void AddBranch()
 {
     CreateBranchWindowVM vm = new CreateBranchWindowVM(this);
     CreateBranchWindow window = new CreateBranchWindow(vm);
     window.Owner = Application.Current.MainWindow;
     if (window.ShowDialog() == true)
     {
         InsertIfThenElseConstruct(vm.IfThenElse);
     }
 }