当前位置: 首页>>代码示例>>C#>>正文


C# Console.Init方法代码示例

本文整理汇总了C#中Console.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Console.Init方法的具体用法?C# Console.Init怎么用?C# Console.Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Console的用法示例。


在下文中一共展示了Console.Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitConsole

		////////////////////////////////////////////////////////////////////////////    

		////////////////////////////////////////////////////////////////////////////
		private void InitConsole()
		{
			TabControl tbc = new TabControl(Manager);
			Console con1 = new Console(Manager);
			Console con2 = new Console(Manager);

			// Setup of TabControl, which will be holding both consoles
			tbc.Init();
			tbc.AddPage("Global");
			tbc.AddPage("Private");

			tbc.Alpha = 220;
			tbc.Left = 220;
			tbc.Height = 220;
			tbc.Width = 400;
			tbc.Top = Manager.TargetHeight - tbc.Height - 32;

			tbc.Movable = true;
			tbc.Resizable = true;
			tbc.MinimumHeight = 96;
			tbc.MinimumWidth = 160;

			tbc.TabPages[0].Add(con1);
			tbc.TabPages[1].Add(con2);

			con1.Init();
			con2.Init();

			con2.Width = con1.Width = tbc.TabPages[0].ClientWidth;
			con2.Height = con1.Height = tbc.TabPages[0].ClientHeight;
			con2.Anchor = con1.Anchor = Anchors.All;

			con1.Channels.Add(new ConsoleChannel(0, "General", Color.Orange));
			con1.Channels.Add(new ConsoleChannel(1, "Private", Color.White));
			con1.Channels.Add(new ConsoleChannel(2, "System", Color.Yellow));

			// We want to share channels and message buffer in both consoles
			con2.Channels = con1.Channels;
			con2.MessageBuffer = con1.MessageBuffer;

			// In the second console we display only "Private" messages
			con2.ChannelFilter.Add(1);

			// Select default channels for each tab
			con1.SelectedChannel = 0;
			con2.SelectedChannel = 1;

			// Do we want to add timestamp or channel name at the start of every message?
			con1.MessageFormat = ConsoleMessageFormats.All;
			con2.MessageFormat = ConsoleMessageFormats.TimeStamp;

			// Handler for altering incoming message
			con1.MessageSent += new ConsoleMessageEventHandler(con1_MessageSent);

			// We send initial welcome message to System channel
			con1.MessageBuffer.Add(new ConsoleMessage("Welcome to Neoforce!", 2));

			Manager.Add(tbc);
		}
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:62,代码来源:Layout.cs

示例2: GeneralDialog

        public GeneralDialog(Manager manager)
        {
            _manager = manager;

            _window = new Window(_manager);
            _window.Init();
            _window.Text = "General";
            _window.Width = 200;
            _window.Height = 200;
            _window.Left = 809;
            _window.Top = 15;
            _window.Visible = true;
            _window.Movable = false;
            _window.CloseButtonVisible = false;

            _wireframe = new CheckBox(_manager);
            _wireframe.Init();
            _wireframe.Text = "Wireframe";
            _wireframe.Width = 100;
            _wireframe.Height = 24;
            _wireframe.Anchor = Anchors.Bottom;
            _wireframe.Left = 15;
            _wireframe.Top = 15;
            _wireframe.Visible = true;
            _wireframe.Parent = _window;

            _terrain = new CheckBox(_manager);
            _terrain.Init();
            _terrain.Text = "Terrain";
            _terrain.Width = 100;
            _terrain.Height = 24;
            _terrain.Anchor = Anchors.Bottom;
            _terrain.Left = 15;
            _terrain.Top = 45;
            _terrain.Visible = true;
            _terrain.Parent = _window;

            _doodad = new CheckBox(_manager);
            _doodad.Init();
            _doodad.Text = "Doodads";
            _doodad.Width = 100;
            _doodad.Height = 24;
            _doodad.Anchor = Anchors.Bottom;
            _doodad.Left = 15;
            _doodad.Top = 75;
            _doodad.Visible = true;
            _doodad.Parent = _window;

            _wmo = new CheckBox(_manager);
            _wmo.Init();
            _wmo.Text = "WMOs";
            _wmo.Width = 100;
            _wmo.Height = 24;
            _wmo.Anchor = Anchors.Bottom;
            _wmo.Left = 15;
            _wmo.Top = 105;
            _wmo.Visible = true;
            _wmo.Parent = _window;

            _water = new CheckBox(_manager);
            _water.Init();
            _water.Text = "Water";
            _water.Width = 100;
            _water.Height = 24;
            _water.Anchor = Anchors.Bottom;
            _water.Left = 15;
            _water.Top = 135;
            _water.Visible = true;
            _water.Parent = _window;

            _console = new Console(_manager);
            _console.Init();
            _console.Left = 15;
            _console.Top = 15;
            _console.Width = 779;
            _console.Height = 200;
            _console.Visible = true;
            _console.Text = "meshDisplay Console";
            _console.Visible = true;
            _console.Movable = false;
            _console.Channels.Add(new ConsoleChannel(1, "Default", Color.White));
            _console.MessageSent += HandleMessage;

            _manager.Add(_console);
            _manager.Add(_window);
        }
开发者ID:Bia10,项目名称:meshReader,代码行数:86,代码来源:GeneralDialog.cs


注:本文中的Console.Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。