Beispiel #1
0
        internal void InitStandardContexts()
        {
            CreateNewContext();
            CreateContext("&Open...", (int)Contexts.Open, MainForm.StandardImages, 1, 0, new NShortcut(Keys.O, Keys.Control), false);
            CreateContext("&Save", (int)Contexts.Save, MainForm.StandardImages, 2, 0, new NShortcut(Keys.S, Keys.Control), false);

            CreateContext("Cu&t", (int)Contexts.Cut, MainForm.StandardImages, 3, 0, new NShortcut(Keys.X, Keys.Control), true);
            CreateContext("&Copy", (int)Contexts.Copy, MainForm.StandardImages, 4, 0, new NShortcut(Keys.C, Keys.Control), false);
            CreateContext("&Paste", (int)Contexts.Paste, MainForm.StandardImages, 5, 0, new NShortcut(Keys.V, Keys.Control), false);
            CreateContext("&Delete", (int)Contexts.Delete, MainForm.StandardImages, 6, 0, new NShortcut(Keys.Delete, Keys.Control), false);

            //create the undo/redo contexts
            NUndoRedoCommandContext c = new NUndoRedoCommandContext();

            c.Properties.ImageIndex = 7;
            c.Properties.ID         = (int)Contexts.Undo;
            c.Properties.Text       = "&Undo";
            c.LabelText             = "Undo";
            c.Properties.ImageList  = MainForm.StandardImages;
            c.Properties.Shortcut   = new NShortcut(Keys.Z, Keys.Control);
            c.Properties.BeginGroup = true;
            c.RangeID       = 0;
            c.Properties.ID = (int)Contexts.Undo;
            m_Manager.Contexts.Add(c);

            c = new NUndoRedoCommandContext();
            c.Properties.ImageIndex = 8;
            c.Properties.Text       = "&Redo";
            c.LabelText             = "Redo";
            c.Properties.ID         = (int)Contexts.Redo;
            c.Properties.ImageList  = MainForm.StandardImages;
            c.Properties.Shortcut   = new NShortcut(Keys.Y, Keys.Control);
            c.RangeID       = 0;
            c.Properties.ID = (int)Contexts.Redo;
            m_Manager.Contexts.Add(c);

            NCommandContext c1 = CreateContext("P&rint", (int)Contexts.Print, MainForm.StandardImages, 9, 0, new NShortcut(Keys.P, Keys.Control), true);

            //c1.Properties.Visible = false;
            CreateContext("Print Pre&view", (int)Contexts.PrintPreview, MainForm.StandardImages, 10, 0, new NShortcut(Keys.P, Keys.Control | Keys.Shift), false);
        }
        internal void InitStandardContexts()
        {
            NCommandContext context1, context2;

            //new project context
            context1 = NCommandContext.CreateContext("New Project...", -1, NIDELoadUC.StandardImageList, 0, (int)NIDELoadUC.RangeID.Standard, null, false);
            m_CommandBarsManager.Contexts.Add(context1);

            context2 = NCommandContext.CreateContext("New Project...", (int)NIDELoadUC.CommandID.NewProject, NIDELoadUC.StandardImageList, 0, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.N, Keys.Control | Keys.Shift), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("New Blank Solution...", (int)NIDELoadUC.CommandID.NewBlankSolution, NIDELoadUC.StandardImageList, 1, (int)NIDELoadUC.RangeID.Standard, null, false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            //add new item context
            context1 = NCommandContext.CreateContext("Add Ne&w Item...", -1, NIDELoadUC.StandardImageList, 2, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.A, Keys.Control | Keys.Shift), false);
            m_CommandBarsManager.Contexts.Add(context1);

            context2 = NCommandContext.CreateContext("Add Ne&w Item...", (int)NIDELoadUC.CommandID.AddNewItem, NIDELoadUC.StandardImageList, 2, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.A, Keys.Control | Keys.Shift), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Add Existin&g Item...", (int)NIDELoadUC.CommandID.AddExistingItem, NIDELoadUC.StandardImageList, 3, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.A, Keys.Alt | Keys.Shift), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Add Windows &Form", (int)NIDELoadUC.CommandID.AddWindowsForm, NIDELoadUC.StandardImageList, 4, (int)NIDELoadUC.RangeID.Standard, null, true);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Add &Inherited Form", (int)NIDELoadUC.CommandID.AddInheritedForm, NIDELoadUC.StandardImageList, 4, (int)NIDELoadUC.RangeID.Standard, null, false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Add &User Control", (int)NIDELoadUC.CommandID.AddUsercontrol, NIDELoadUC.StandardImageList, 5, (int)NIDELoadUC.RangeID.Standard, null, false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Add Inherited Con&trol", (int)NIDELoadUC.CommandID.AddInheritedControl, NIDELoadUC.StandardImageList, 5, (int)NIDELoadUC.RangeID.Standard, null, false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Add Compo&nent", (int)NIDELoadUC.CommandID.AddComponent, NIDELoadUC.StandardImageList, 6, (int)NIDELoadUC.RangeID.Standard, null, false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Add &Class...", (int)NIDELoadUC.CommandID.AddClass, NIDELoadUC.StandardImageList, 7, (int)NIDELoadUC.RangeID.Standard, null, false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            //open context
            context1 = NCommandContext.CreateContext("&Open...", (int)NIDELoadUC.CommandID.Open, NIDELoadUC.StandardImageList, 8, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.O, Keys.Control), true);
            m_CommandBarsManager.Contexts.Add(context1);

            //save context
            context1 = NCommandContext.CreateContext("Sa&ve", (int)NIDELoadUC.CommandID.Save, NIDELoadUC.StandardImageList, 9, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.S, Keys.Control), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //save all context
            context1 = NCommandContext.CreateContext("Save A&ll", (int)NIDELoadUC.CommandID.SaveAll, NIDELoadUC.StandardImageList, 10, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.S, Keys.Control | Keys.Shift), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //cut context
            context1 = NCommandContext.CreateContext("Cu&t", (int)NIDELoadUC.CommandID.Cut, NIDELoadUC.StandardImageList, 11, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.X, Keys.Control), true);
            m_CommandBarsManager.Contexts.Add(context1);

            //copy context
            context1 = NCommandContext.CreateContext("&Copy", (int)NIDELoadUC.CommandID.Copy, NIDELoadUC.StandardImageList, 12, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.C, Keys.Control), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //paste context
            context1 = NCommandContext.CreateContext("&Paste", (int)NIDELoadUC.CommandID.Paste, NIDELoadUC.StandardImageList, 13, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.V, Keys.Control), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //undo context
            context1 = new NUndoRedoCommandContext();
            context1.Properties.ImageIndex = 14;
            context1.Properties.ID         = (int)NIDELoadUC.CommandID.Undo;
            context1.Properties.Text       = "&Undo";
            context1.Properties.ImageList  = NIDELoadUC.StandardImageList;
            context1.Properties.Shortcut   = new NShortcut(Keys.Z, Keys.Control);
            context1.Properties.BeginGroup = true;
            context1.RangeID = (int)NIDELoadUC.RangeID.Standard;
            m_CommandBarsManager.Contexts.Add(context1);

            //redo context
            context1 = new NUndoRedoCommandContext();
            context1.Properties.ImageIndex = 15;
            context1.Properties.Text       = "&Redo";
            context1.Properties.ID         = (int)NIDELoadUC.CommandID.Redo;
            context1.Properties.ImageList  = NIDELoadUC.StandardImageList;
            context1.Properties.Shortcut   = new NShortcut(Keys.Y, Keys.Control);
            context1.RangeID = (int)NIDELoadUC.RangeID.Standard;
            m_CommandBarsManager.Contexts.Add(context1);

            //navigate backward context
            context1 = NCommandContext.CreateContext("N&avigate Backward", (int)NIDELoadUC.CommandID.NavigateBackward, NIDELoadUC.StandardImageList, 16, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.OemMinus, Keys.Control), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //navigate forward context
            context1 = NCommandContext.CreateContext("Navigate &Forward", (int)NIDELoadUC.CommandID.NavigateForward, NIDELoadUC.StandardImageList, 17, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.OemMinus, Keys.Control | Keys.Shift), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //start debug context
            context1 = NCommandContext.CreateContext("Start / Continue", (int)NIDELoadUC.CommandID.StartContinue, NIDELoadUC.StandardImageList, 18, (int)NIDELoadUC.RangeID.Standard, null, true);
            m_CommandBarsManager.Contexts.Add(context1);

            //solution configuration context
            NComboBoxCommandContext context3 = new NComboBoxCommandContext();

            context3.Properties.ID = (int)NIDELoadUC.CommandID.SolutionConfigurations;
            context3.ListProperties.ColumnOnLeft = false;
            context3.ListProperties.ItemHeight   = 15;
            context3.ComboBox.DropDownWidth      = 160;
            context3.Properties.Text             = "Solution Configurations";
            context3.RangeID = (int)NIDELoadUC.RangeID.Standard;

            context3.Items.Add("Debug");
            context3.Items.Add("Release");
            context3.Items.Add("Configuration Manager...");
            context3.ComboBox.SelectedIndex = 0;
            m_CommandBarsManager.Contexts.Add(context3);

            //solution explorer context
            context1 = NCommandContext.CreateContext("Solution &Explorer", (int)NIDELoadUC.CommandID.SolutionExplorer, NIDELoadUC.StandardImageList, 19, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.L, Keys.Control | Keys.Alt), true);
            m_CommandBarsManager.Contexts.Add(context1);

            //properties window context
            context1 = NCommandContext.CreateContext("Properties &Window", (int)NIDELoadUC.CommandID.Properties, NIDELoadUC.StandardImageList, 20, (int)NIDELoadUC.RangeID.Standard, null, false);
            m_CommandBarsManager.Contexts.Add(context1);

            //object browser context
            context1 = NCommandContext.CreateContext("Ob&ject Browser", (int)NIDELoadUC.CommandID.ObjectBrowser, NIDELoadUC.StandardImageList, 21, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.J, Keys.Control | Keys.Alt), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //toolbox context
            context1 = NCommandContext.CreateContext("Toolbo&x", (int)NIDELoadUC.CommandID.Toolbox, NIDELoadUC.StandardImageList, 22, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.X, Keys.Control | Keys.Alt), false);
            m_CommandBarsManager.Contexts.Add(context1);

            //class view context
            context1 = NCommandContext.CreateContext("Cl&ass View", -1, NIDELoadUC.StandardImageList, 23, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.C, Keys.Control | Keys.Shift), false);
            m_CommandBarsManager.Contexts.Add(context1);

            context2 = NCommandContext.CreateContext("Cl&ass View", (int)NIDELoadUC.CommandID.ClassView, NIDELoadUC.StandardImageList, 23, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.C, Keys.Control | Keys.Shift), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Ser&ver Explorer", (int)NIDELoadUC.CommandID.ServerExplorer, NIDELoadUC.StandardImageList, 24, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.S, Keys.Control | Keys.Alt), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("&Resource View", (int)NIDELoadUC.CommandID.ResourceView, NIDELoadUC.StandardImageList, 25, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.E, Keys.Control | Keys.Shift), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("&Task List", (int)NIDELoadUC.CommandID.TaskList, NIDELoadUC.StandardImageList, 26, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.K, Keys.Control | Keys.Alt), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Comma&nd Window", (int)NIDELoadUC.CommandID.CommandWindow, NIDELoadUC.StandardImageList, 27, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.A, Keys.Control | Keys.Alt), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("&Output", (int)NIDELoadUC.CommandID.Output, NIDELoadUC.StandardImageList, 28, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.O, Keys.Control | Keys.Alt), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);

            context2 = NCommandContext.CreateContext("Find S&ymbol Results", (int)NIDELoadUC.CommandID.FindSymbolResults, NIDELoadUC.StandardImageList, 29, (int)NIDELoadUC.RangeID.Standard, new NShortcut(Keys.F12, Keys.Control | Keys.Alt), false);
            context1.Contexts.Add(context2);
            m_CommandBarsManager.Contexts.Add(context2);
        }