コード例 #1
0
        private void m_ExecuteButton_Click(object sender, System.EventArgs e)
        {
            NDockingFrameworkCommand comm = m_AvailableCommandsCombo.SelectedItem as NDockingFrameworkCommand;

            if (comm == null)
            {
                return;
            }

            comm.Execute(null);
        }
コード例 #2
0
        private void shortcutEdit_TextChanged(object sender, System.EventArgs e)
        {
            NDockingFrameworkCommand command = nDockManager1.Commander.GetCommandById(NDockingFrameworkCommands.VisualTabNavigation);

            if (command == null)
            {
                return;
            }

            command.Shortcuts.Clear();
            command.Shortcuts.Add(shortcutEdit.Shortcut);
        }
コード例 #3
0
        void AddCustomCommands()
        {
            NDockingFrameworkCommand comm;

            EventHandler eh = new EventHandler(comm_Executed);

            comm           = new NDockingFrameworkCommand(101, "Custom Command 1");
            comm.Executed += eh;
            nDockManager1.Commander.RegisterCommand(comm);

            comm           = new NDockingFrameworkCommand(102, "Custom Command 2");
            comm.Executed += eh;
            nDockManager1.Commander.RegisterCommand(comm);
        }
コード例 #4
0
        public NVisualTabNavigationForm()
        {
            InitializeComponent();

            this.editorModeCombo.FillFromEnum(typeof(VisualTabEditorMode));
            this.editorModeCombo.SelectedItem = nDockManager1.VisualTabEditorMode;

            NDockingFrameworkCommand command = nDockManager1.Commander.GetCommandById(NDockingFrameworkCommands.VisualTabNavigation);

            if (command != null)
            {
                ArrayList shortcuts = command.Shortcuts;
                if (shortcuts.Count > 0)
                {
                    shortcutEdit.SetShortcut((NShortcut)shortcuts[0]);
                }
            }

            nDockManager1.DocumentStyle.ImageList = imageList1;
            NDocumentManager docManager = nDockManager1.DocumentManager;

            docManager.Suspend();

            NUIDocument doc;
            int         imageIndex = 0;

            for (int i = 0; i < 10; i++)
            {
                doc = new NUIDocument("Test Document " + i, imageIndex);
                docManager.AddDocument(doc);

                imageIndex++;
                if (imageIndex > 5)
                {
                    imageIndex = 0;
                }
            }

            docManager.Resume();
        }
コード例 #5
0
        private void comm_Executed(object sender, EventArgs e)
        {
            NDockingFrameworkCommand comm = sender as NDockingFrameworkCommand;

            MessageBox.Show("Custom command executed:\n" + comm.Name);
        }