Example #1
0
        private void NewAction(bool preAction)
        {
            ItemSelector selector = new ItemSelector();

            selector.Initialize(ActionFactory.GetActionList(SelectedSolution).ToList <object>(), "Action Type");
            if (selector.ShowIfMultiple() == DialogResult.OK && selector.SelectedItem != null)
            {
                BaseAction da = ActionFactory.CreateAction((BaseAction)selector.SelectedItem);
                da.Solution = SelectedSolution;
                ComponentControl ac = new ComponentControl();

                ac.Setup(da, da.Id + " - Properties");

                if (ac.ShowDialog() == DialogResult.OK)
                {
                    ac.UpdateComponent(da);

                    if (SelectedSolution != null)
                    {
                        if (preAction)
                        {
                            SelectedSolution.BuildActions.Add(da);
                            lbPreActions.Items.Add(da);
                            Package.HasUnsavedChanges = true;
                        }
                        else
                        {
                            SelectedSolution.DeployActions.Add(da);
                            lbPostActions.Items.Add(da);
                            Package.HasUnsavedChanges = true;
                        }
                    }
                }
            }
        }
Example #2
0
        private void NewSolution()
        {
            ItemSelector selector = new ItemSelector();

            selector.Initialize(SolutionFactory.GetSolutionList(Package).ToList <object>(), "Solution Type");
            if (selector.ShowIfMultiple() == DialogResult.OK && selector.SelectedItem != null)
            {
                BaseSolution sln = SolutionFactory.CreateSolution((BaseSolution)selector.SelectedItem);
                sln.Package = Package;
                ComponentControl ac = new ComponentControl();
                ac.Setup(sln, "Solution Properties");

                if (ac.ShowDialog() == DialogResult.OK)
                {
                    ac.UpdateComponent(sln);
                    Package.HasUnsavedChanges = true;
                    Package.Solutions.Add(sln);
                    lbSolutions.Items.Add(sln);
                    lbSolutions.SelectedIndex = lbSolutions.Items.Count - 1;
                    ResetActions();
                }
            }
        }
Example #3
0
        private void NewPackage()
        {
            if (SaveIfRequired())
            {
                ItemSelector selector = new ItemSelector();
                selector.Initialize(PackageFactory.GetPackageList().ToList <object>(), "Package Type");
                if (selector.ShowIfMultiple() == DialogResult.OK && selector.SelectedItem != null)
                {
                    BaseChangePackage pkg = PackageFactory.CreatePackage((BaseChangePackage)selector.SelectedItem);
                    pkg.HasUnsavedChanges = false;
                    ComponentControl ac = new ComponentControl();

                    pkg.Name = "New Change Package";
                    ac.Setup(pkg, "Package Properties");

                    if (ac.ShowDialog() == DialogResult.OK)
                    {
                        ac.UpdateComponent(pkg);
                        Package = pkg;
                    }
                }
            }
        }