コード例 #1
0
        protected override void nCommandBarsManager1_CommandClicked(object sender, CommandEventArgs e)
        {
            NCommand comm = e.Command;
            int      id   = comm.Properties.ID;

            NDocumentManager manager = m_DockManager.DocumentManager;

            switch (id)
            {
            case 0:
                for (int i = 0; i < 1; i++)
                {
                    int     index = manager.Documents.Length + 1;
                    TextBox tb    = GetTextBox();
                    tb.BorderStyle = BorderStyle.None;

                    NUIDocument doc = new NUIDocument("Document " + index.ToString(), 0, tb);
                    manager.AddDocument(doc);
                }
                break;

            case 1:
                manager.CloseActiveDocument();
                break;

            case 2:
                manager.CloseAllDocuments();
                break;

            case 3:
                manager.LayoutMdi(MdiLayout.TileHorizontal);
                break;

            case 4:
                manager.LayoutMdi(MdiLayout.TileVertical);
                break;

            case 5:
                manager.LayoutMdi(MdiLayout.Cascade);
                break;

            case 6:
                manager.LayoutMdi(MdiLayout.ArrangeIcons);
                break;

            case 7:
                manager.ShowDocumentsEditor();
                break;

            case 8:
                manager.CloseAllButActive();
                break;
            }
        }
コード例 #2
0
        public NMdiChildrenCustomFramesForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            NDocumentManager manager = nDockManager1.DocumentManager;

            for (int i = 1; i < 5; i++)
            {
                manager.AddDocument(new NUIDocument("Document " + i.ToString()));
            }
        }
コード例 #3
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();
        }