Esempio n. 1
0
        }//CreateStandardConsole

        /// <summary>
        /// Get a standard console.
        /// </summary>
        /// <param name="title">title of the requested standard console</param>
        /// <returns>handle of console</returns>
        public uint GetStandardConsole(string title)
        {
            foreach (TabPage tabPage in this.tabControl1.TabPages)
            {
                StandardIOConsole console = tabPage.Tag as StandardIOConsole;
                if (console != null && tabPage.Text == title)
                {
                    return(console.ConsoleHandle);
                }
            }
            return(CreateStandardConsole(title));
        }//GetStandardConsole
Esempio n. 2
0
        }//GetStandardConsole

        /// <summary>
        /// Close a standard console. Removes it from the tab control and remove from the list
        /// of consoles.
        /// </summary>
        /// <param name="handle">handle of console to close</param>
        public void CloseStandardConsole(uint handle)
        {
            if (mStandardIOConsoles.ContainsKey(handle))
            {
                foreach (TabPage tabPage in this.tabControl1.TabPages)
                {
                    StandardIOConsole console = tabPage.Tag as StandardIOConsole;
                    if (console != null && console.ConsoleHandle == handle)
                    {
                        this.tabControl1.TabPages.Remove(tabPage);
                        mStandardIOConsoles.Remove(handle);
                        break;
                    } //if
                }     //foreach
            }         //if
        }             //CloseStandardConsole
Esempio n. 3
0
        /// <summary>
        /// Creates a new standard console. A tab is created in the output view
        /// with the title set to the one given.
        /// The console is added to the list of standard consoles and a handle
        /// returned to the caller.
        /// </summary>
        /// <param name="title">title of the new standard console</param>
        /// <returns>handle of console</returns>
        public uint CreateStandardConsole(string title)
        {
            StandardIOConsole console = new StandardIOConsole();

            console.ConsoleHandle           = _nextHandle++;
            console.CurrentFont             = this.CurrentFont;
            console.CurrentBackgroundColour = this.CurrentBackgroundColour;
            console.CurrentTextColour       = this.CurrentTextColour;
            console.Dock = DockStyle.Fill;
            mStandardIOConsoles.Add(console.ConsoleHandle, console);

            TabPage tabPage = new TabPage();

            tabPage.Text = title;
            tabPage.Tag  = console;
            tabPage.Controls.Add(console);

            this.tabControl1.TabPages.Add(tabPage);
            this.tabControl1.SelectedTab = tabPage;
            return(console.ConsoleHandle);
        }//CreateStandardConsole