Ejemplo n.º 1
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();
                }
            }
        }