• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ComponentModel.Container类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ComponentModel.Container的典型用法代码示例。如果您正苦于以下问题:C# Container类的具体用法?C# Container怎么用?C# Container使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Container类属于System.ComponentModel命名空间,在下文中一共展示了Container类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Connect_Click

        // public decimal Port { get; set; }
        private void Connect_Click(object sender, EventArgs e)
        {
            System.ComponentModel.IContainer components = new System.ComponentModel.Container();
                serialPort1 = new System.IO.Ports.SerialPort(components); // Creating the new object.
                serialPort1.PortName = "COM" + COM.Value.ToString(); // Setting what port number.
                serialPort1.BaudRate = 9600; // Setting baudrate.
                serialPort1.DtrEnable = true; // Enable the Data Terminal Ready

                try
                {
                    serialPort1.Open(); // Open the port for use.
                    isConnected = true;
                    Port = COM.Value;
                }
                catch
                {
                    MessageBox.Show("Device not found");
                }
                finally
                {
                    if (serialPort1.IsOpen)
                    {
                        ConnectButton.Text = "Close";
                        //   ConnectButton.Enabled = false;
                        COM.Enabled = false;
                        SuccessLabel.Text = "Connection succesful";
                    }
                }
        }
开发者ID:terodelarosa,项目名称:RgbLedController,代码行数:30,代码来源:Form2.cs


示例2: Form1

        public Form1()
        {
            InitializeComponent();

            m_backgroundBm = new Bitmap(Image.FromFile("me.jpg"));
            m_frameBuf = new Bitmap(m_backgroundBm.Width, m_backgroundBm.Height);

            m_rippleBufs = new short[2][,] { new short[m_backgroundBm.Height, m_backgroundBm.Width], null };
            for (int y = 0; y < m_rippleBufs[0].GetLength(0); ++y)
            {
                for (int x = 0; x < m_rippleBufs[0].GetLength(1); ++x)
                {
                    m_rippleBufs[0][y, x] = 0;
                }
            }
            m_rippleBufs[1] = (short[,])m_rippleBufs[0].Clone();
            m_activeRippleBuf = 0;

            ClientSize = new Size(m_backgroundBm.Width, m_backgroundBm.Height);
            FormBorderStyle = FormBorderStyle.FixedDialog;
            MinimizeBox = MaximizeBox = false;

            if (components == null) components = new Container();
            Timer timer = new Timer(components);
            timer.Tick += (sender, e) => this.UpdateFrame();
            timer.Interval = 10;
            timer.Start();

            m_paintFps = 0;
            timer = new Timer(components);
            // timer.Tick += (sender, e) => { Debug.Print("paintFps: " + m_paintFps + " updateFps: " + m_updateFps);  m_paintFps = m_updateFps = 0; };
            timer.Interval = 1000;
            timer.Start();
        }
开发者ID:GHScan,项目名称:DailyProjects,代码行数:34,代码来源:Form1.cs


示例3: ShowNotification

        static void ShowNotification(string text, string title)
        {
            var container = new Container();
            var wait = new ManualResetEvent(false);
            var trayicon = new NotifyIcon(container);
            EventHandler done = null;
            done = delegate {
                wait.Set();
                trayicon.BalloonTipClosed  -= done;
                trayicon.BalloonTipClicked -= done;
            };
            trayicon.BalloonTipClicked += done;
            trayicon.BalloonTipClosed  += done;
            trayicon.BalloonTipTitle = title;
            trayicon.BalloonTipText = text;
            var exe = Environment.GetFolderPath(
                            Environment.SpecialFolder.ProgramFilesX86) +
                            @"\iTunes\iTunes.exe";
            var icon = Icon.ExtractAssociatedIcon(exe);
            trayicon.Icon = new Icon(icon, 16, 16);

            trayicon.Visible = true;
            trayicon.ShowBalloonTip(5000);
            wait.WaitOne(10000);
            trayicon.Visible = false;
            trayicon.Dispose();
            icon.Dispose();
            container.Dispose();
        }
开发者ID:pfn,项目名称:itunes-controller,代码行数:29,代码来源:iTunesC.cs


示例4: InitializeComponent

		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.snoop_     = new NuGenSnoopControl (); 
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.SuspendLayout();
			// 
			// snoop_
			// 
			this.snoop_.Dock = System.Windows.Forms.DockStyle.Fill;			
			// 
			// timer1
			// 
			this.timer1.Interval = 10;
			this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
			// 
			// WindowPropertiesView
			// 
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.snoop_});
			this.Name = "SnoopCarrier";
			this.Size = new System.Drawing.Size(280, 384);
			this.ResumeLayout(false);

		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:29,代码来源:SnoopCarrier.cs


示例5: ConfigurePort

 private void ConfigurePort(string comPort)
 {
     IContainer components = new Container();
     _arduinoPort = new SerialPort(components);
     _arduinoPort.PortName = comPort;
     _arduinoPort.BaudRate = 9600;
 }
开发者ID:karaaie,项目名称:SLInfo,代码行数:7,代码来源:Writer.cs


示例6: Form1

		public Form1()
		{
			this.components = new System.ComponentModel.Container();
			this.Size = new System.Drawing.Size(300,300);
			this.Text = "Scribble.net";
			this.BackColor = Color.White;
			this.MouseDown += 
				new System.Windows.Forms.MouseEventHandler(this.Form_MouseDown);
			this.MouseMove += new MouseEventHandler(MouseMoveHandler);
			this.MouseUp += new MouseEventHandler(MouseUpHandler);
			
			label1 = new System.Windows.Forms.Label();
			label1.Size = new System.Drawing.Size(200, 20);
			label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			label1.Text = "First Name:";
			this.Controls.Add(label1);
			
			this.SuspendLayout();
			this.Load += new System.EventHandler(this.Form1_Load);

			myBrush = new System.Drawing.SolidBrush(Color.Black);
			
			recognizer = new AlphaRecognizer();
			recognizer.Initialize();
			label1.Text = recognizer.Verify();
		}
开发者ID:jcouv,项目名称:jcouv.github.io,代码行数:26,代码来源:MainForm.cs


示例7: InitializeComponent

    public void InitializeComponent()
    {
        this.components=new System.ComponentModel.Container();
            this.button3=new System.Windows.Forms.Button();
            this.button2=new System.Windows.Forms.Button();
            this.button1=new System.Windows.Forms.Button();

            button2.Location=new System.Drawing.Point(16,40);
            button2.FlatStyle=System.Windows.Forms.FlatStyle.Flat;
            button2.Size=new System.Drawing.Size(408,296);
            button2.TabIndex=1;

            button3.Location=new System.Drawing.Point(200,8);
            button3.Size=new System.Drawing.Size(72,24);
            button3.TabIndex=3;
            button3.Text="&Close";
            button3.Click+=new System.EventHandler(this.button3_Click);

            button1.Location=new System.Drawing.Point(336,8);
            button1.Size=new System.Drawing.Size(80,24);
            button1.TabIndex=2;
            button1.Text="Browse";
            button1.Click+=new System.EventHandler(this.button1_Click);

            this.Text="iText Image Viewer";
            this.AutoScaleBaseSize=new System.Drawing.Size(5,13);
            this.ClientSize=new System.Drawing.Size(448,357);

            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
    }
开发者ID:mymindleaks,项目名称:iText,代码行数:32,代码来源:CPad.cs


示例8: Console

        public Console()
        {
            System.ComponentModel.IContainer components = new System.ComponentModel.Container();
            serialPort1 = new System.IO.Ports.SerialPort(components);
            serialPort1.PortName = "COM1";
            serialPort1.BaudRate = 9600;

            try
            {
                serialPort1.Open();
            }
            catch (Exception)
            {
                //throw;
            }

            if (!serialPort1.IsOpen)
            {
                MessageBox.Show("Error opening serial port " + serialPort1.PortName + ". Application exiting");
                //return;
            }

            serialPort1.DtrEnable = true;
            // start up
            System.Threading.Thread.Sleep(2000);
            serialPort1.DataReceived += OnReceived;
            InitializeComponent();
        }
开发者ID:edgardurao,项目名称:ArduinoSerialCSharp,代码行数:28,代码来源:Console.cs


示例9: GaGa

        /// <summary>
        /// GaGa implementation.
        /// </summary>
        /// <param name="streamsFilePath">
        /// Path for the streams file to use.
        /// </param>
        public GaGa(String streamsFilePath)
        {
            // streams file and loader:
            streamsFile = new StreamsFile(streamsFilePath, "GaGa.Resources.streams.ini");
            menuLoader = new StreamsMenuLoader(streamsFile);

            // gui components:
            container = new Container();

            notifyIcon = new NotifyIcon(container);
            notifyIcon.Visible = true;

            MenuRecreate();

            // error items:
            errorOpenItem = new MenuItem("Error opening streams file (click for details)", OnErrorOpenItemClick);
            errorReadItem = new MenuItem("Error reading streams file (click for details)", OnErrorReadItemClick);

            // constant items:
            editItem = new MenuItem("Edit streams file", OnEditItemClick);
            exitItem = new MenuItem("Exit", OnExitItemClick);

            // playing:
            player = new Player(notifyIcon);
        }
开发者ID:JamieSharpe,项目名称:GaGa,代码行数:31,代码来源:GaGa.cs


示例10: VS2005DockPaneCaption

        public VS2005DockPaneCaption(DockPane pane) : base(pane)
        {
            SuspendLayout();

            Font = PluginCore.PluginBase.Settings.DefaultFont;
            m_components = new Container();
            m_toolTip = new ToolTip(Components);

            // Adjust size based on scale
            double scale = ScaleHelper.GetScale();
            if (scale >= 2) // 200%
            {
                _TextGapTop = 3;
                _TextGapBottom = 6;
                _ButtonGapBottom = 4;
            }
            else if (scale >= 1.5) // 150%
            {
                _TextGapTop = 2;
                _TextGapBottom = 4;
                _ButtonGapBottom = 4;
            }
            else if (scale >= 1.2) // 120%
            {
                _TextGapTop = 2;
                _TextGapBottom = 2;
            }
            // Else 100%

            ResumeLayout();
        }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:31,代码来源:VS2005DockPaneCaption.cs


示例11: LeanKitNotifierApplicationContext

		public LeanKitNotifierApplicationContext()
		{
			var container = new Container();
			var contextMenu = new ContextMenu();

			//var displaySettings = new MenuItem("Settings");
			//displaySettings.Click += DisplaySettingsOnClick;
			//contextMenu.MenuItems.Add(displaySettings);

			var exitMenu = new MenuItem("Exit");
			exitMenu.Click += ExitMenuOnClick;
			contextMenu.MenuItems.Add(exitMenu);

			// Create the NotifyIcon.
			var iconPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\app.ico";

			_notifyIcon = new NotifyIcon(container)
			{
				Icon = new Icon(iconPath),
				ContextMenu = contextMenu,
				Visible = true,
				Text = @"LeanKit Notifier"
			};

			InitializeLeanKitMonitoring();
		}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:26,代码来源:LeanKitNotifierApplicationContext.cs


示例12: FindDuplicates

        public FindDuplicates()
        {
            InitializeComponent();

            if (components == null)
                components = new Container();

            duplicates = new Queue<KeyValuePair<Duplicate,Duplicate>>(DataStore.Database.FindDuplicateListItems());

            if (duplicates.Count == 0) {
                MessageBox.Show(Properties.Resources.NoDuplicateEntriesFound, base.Text, MessageBoxButtons.OK,
                                MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                Close();
                return;
            }

            GoToNext();

            leftTermEditor.ItemDeleted += TermEditorItemDeleted;
            rightTermEditor.ItemDeleted += TermEditorItemDeleted;

            var boldFont = new Font(base.Font, FontStyle.Bold);
            components.Add(new DisposableComponent(boldFont));
            leftListName.Font = rightListName.Font = boldFont;
        }
开发者ID:lehoaian,项目名称:szotar,代码行数:25,代码来源:FindDuplicates.cs


示例13: ObedienceContext

        internal ObedienceContext()
        {
            //Instantiate the component Module to hold everything
            _components = new System.ComponentModel.Container();
            Trace.Listeners.Add(new TextWriterTraceListener("C:\\temp\\Obedience.log"));
            
            //Instantiate the NotifyIcon attaching it to the components container and 
            //provide it an icon, note, you can imbed this resource 
            _notifyIcon = new NotifyIcon(_components);
            _notifyIcon.Icon = Resources.AppIcon;
            _notifyIcon.Text = "Obedience";
            _notifyIcon.Visible = true;

            //Instantiate the context menu and items
            var contextMenu = new ContextMenuStrip();
            var displayForm = new ToolStripMenuItem();
            var exitApplication = new ToolStripMenuItem();

            //Attach the menu to the notify icon
            _notifyIcon.ContextMenuStrip = contextMenu;

            //Setup the items and add them to the menu strip, adding handlers to be created later
            displayForm.Text = "Do something";
            displayForm.Click += mDisplayForm_Click;
            contextMenu.Items.Add(displayForm);

            exitApplication.Text = "Exit";
            exitApplication.Click += mExitApplication_Click;
            contextMenu.Items.Add(exitApplication);
            Trace.WriteLine("Obedience started");
            scanner = new AcdController(new IPEndPoint(new IPAddress(new byte[] {10, 0, 3, 220}), 5003));
            //scanner.Reboot();
            Trace.AutoFlush = true;
            scanner.ConnectedChanged += new ConnectedChangedEventHandler(scanner_ConnectedChanged);
        }
开发者ID:Cool2Feel,项目名称:cuda-fingerprinting,代码行数:35,代码来源:ObedienceContext.cs


示例14: InitializeComponent

 /// <summary>
 ///    Required method for Designer support - do not modify
 ///    the contents of this method with the code editor.
 /// </summary>
 void InitializeComponent () {
     this.components = new System.ComponentModel.Container ();
     this.ForeColor = System.Drawing.Color.White;
     this.BackColor = System.Drawing.Color.Black;
     this.Size = new System.Drawing.Size(100, 23);
     this.Text = "FlashTrackBar";
 }
开发者ID:yaronthurm,项目名称:TagFolders,代码行数:11,代码来源:FlashTrackBar.cs


示例15: MultiTextControl

        public MultiTextControl(WritingSystemCollection allWritingSystems)
        {
            SuspendLayout();
            _allWritingSystems = allWritingSystems;
            components = new Container();
            InitializeComponent();
            _textBoxes = new List<WeSayTextBox>();
            //this.BackColor = System.Drawing.Color.Crimson;
            _writingSystemLabelFont = new Font(FontFamily.GenericSansSerif, 9);

            if (-1 == WidthForWritingSystemLabels)
            {
                //happens when this is from a hand-placed designer piece,
                //in which case we don't really care about aligning anyhow
                ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); //ws label
            }
            else
            {
                ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, WidthForWritingSystemLabels));
            }
            ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100)); //text
            ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); //annotation widget

            ResumeLayout(false);
        }
开发者ID:bbriggs,项目名称:wesay,代码行数:25,代码来源:MultiTextControl.cs


示例16: Arranger

		/// <summary>
		/// Creates a new arranger control
		/// </summary>
		public Arranger(Container Components)
		{
			components = Components;
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call
		}
开发者ID:teetow,项目名称:teevegas,代码行数:11,代码来源:Arranger.cs


示例17: BaseGLControl

		public BaseGLControl()
		{
			InitializeComponent();
			this.components = new System.ComponentModel.Container();
			//Attach load and size change event handlers
			this.Load += new EventHandler(InitializeGL);
			this.SizeChanged += new EventHandler(ResizeGL);
		}
开发者ID:CanteroA,项目名称:letrasOpenGL,代码行数:8,代码来源:BaseGL.cs


示例18: Form1

 public Form1(Container.Dictionary<string, string> response)
 {
     InitializeComponent();
     this.UpdateNotifier.Text = response["MESSAGE"];
     this.UpdateNotifier.BalloonTipText = response["MESSAGE"];
     this.uri_ = response["URL"];
     this.UpdateNotifier.ShowBalloonTip(30000);
 }
开发者ID:neojjang,项目名称:cubepdf,代码行数:8,代码来源:Form1.cs


示例19: main

        public main()
        {
            IniParser.FileIniDataParser parser = new FileIniDataParser();
            IniData parsedData = parser.LoadFile("setting/ui-setting.ini");
            rubyPath = parsedData["PATH"]["ruby"];
            compassPath = parsedData["PATH"]["compass"];
            dirListPath = parsedData["PATH"]["dirlist"];
            frameworkPath = parsedData["PATH"]["framework"];
            ///

            components = new System.ComponentModel.Container();
            this.contextMenu1 = new System.Windows.Forms.ContextMenu();
            this.menuItem0 = new System.Windows.Forms.MenuItem();
            this.menuItem1 = new System.Windows.Forms.MenuItem();

            // Initialize contextMenu1
            this.contextMenu1.MenuItems.AddRange(
                        new System.Windows.Forms.MenuItem[] { this.menuItem0,this.menuItem1 });

            // Initialize menuItem1
            this.menuItem1.Index = 1;
            this.menuItem1.Text = "E&xit";
            this.menuItem1.Click += new System.EventHandler(this.exitWindowHander);

            this.menuItem0.Index = 0;
            this.menuItem0.Text = "H&ide";
            this.menuItem0.Click += new System.EventHandler(this.showWindowHander);
            // Set up how the form should be displayed.
            this.ClientSize = new System.Drawing.Size(292, 266);
            this.Text = "Compass Bundle UI";

            // Create the NotifyIcon.
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);

            // The Icon property sets the icon that will appear
            // in the systray for this application.

            notifyIcon1.Icon = new Icon(Directory.GetCurrentDirectory()+"/icon/compass_icon.ico");

            // The ContextMenu property sets the menu that will
            // appear when the systray icon is right clicked.
            notifyIcon1.ContextMenu = this.contextMenu1;

            // The Text property sets the text that will be displayed,
            // in a tooltip, when the mouse hovers over the systray icon.
            notifyIcon1.Text = "Compass Bundle UI";
            notifyIcon1.Visible = true;

            // Handle the DoubleClick event to activate the form.
            notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
            //MessageBox.Show(compassBatPath);
            InitializeComponent();
            this.loadList();
            this.add2CLI("load the default folder list.");
            this.write2Xml();
            this.initCreateList();
            this.Show();
        }
开发者ID:cokeetang,项目名称:compass-bundle,代码行数:58,代码来源:Form1.cs


示例20: InitializeComponent

 private void InitializeComponent()
 {
     this.components = new Container();
     base.SuspendLayout();
     this.Font = new Font("Tahoma", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0xcc);
     base.Name = "BaseStep";
     base.Size = new Size(0x225, 290);
     base.ResumeLayout(false);
 }
开发者ID:kostrse,项目名称:WinFormsWizard,代码行数:9,代码来源:WizardStepBase.Designer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ComponentModel.DoWorkEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# ComponentModel.ComponentResourceManager类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap