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


C# ComponentModel.Container类代码示例

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


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


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