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


C# Timer.Start方法代码示例

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


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

示例1: TimerLogic

        public TimerLogic()
        {
            m_timer = new Timer();
            m_timer.Interval = m_tick;

            m_timer.Tick += delegate
            {
                m_log.Debug("Tick event happened");
                m_timer.Stop();
                // Commented until find bugs
            //				if(MousePositionHelper.MouseNotMoving == false)
            //				{
                    List<Task> tasksToShow = new DbHelper().LoadTasksForShowing();
                    m_log.DebugFormat("Loaded {0} tasks for showing", tasksToShow.Count);
                    foreach (Task task in tasksToShow)
                    {
                        new TaskShowController(task).PrepareWindow(); //Įkėliau viską į preparerį.
                        m_log.DebugFormat("Showed task with id {0}, name {1}, showTime {2}",
                                          task.Id, task.Text, DBTypesConverter.ToFullDateStringByCultureInfo(task.DateRemainder));
                    }
            //				}

                SetNewTimerInterval();
                m_timer.Start();
            };

            m_timer.Start();
        }
开发者ID:povilaspanavas,项目名称:minder,代码行数:28,代码来源:TimerLogic.cs

示例2: CanTimerBeRestarted

 public void CanTimerBeRestarted() {
     //Arrange
     var timer = new Timer();
     timer.Interval = 1000*3;
     //Act
     timer.Start();
     timer.Start();
     //Assert
     Assert.IsNotNull(timer);
 }
开发者ID:darrelmiller,项目名称:RESTAgent.Samples,代码行数:10,代码来源:ClientStateTests.cs

示例3: Home2_Load

        private void Home2_Load(object sender, EventArgs e)
        {
            Timer tmr = new Timer();
            tmr.Interval = 1000;//ticks every 1 second
            tmr.Tick += new EventHandler(timer1_Tick);
            tmr.Start();

               tmr.Start();
            //   pictureBox1.Image = Image.FromFile("images/" + pictures[0]);
        }
开发者ID:pafennell,项目名称:SoftwareEngineering,代码行数:10,代码来源:Home2.cs

示例4: InitTimerValidation

 public void InitTimerValidation()
 {
     _timerAuth = new Timer();
     _timerAuth.Tick += new EventHandler(InvokeValidation);
     _timerAuth.Interval = 21600000; //6h
     _timerAuth.Start();
 }
开发者ID:vitobcn,项目名称:cryptoTriangular,代码行数:7,代码来源:MainWindow.cs

示例5: frmSplash

        public frmSplash()
        {
            InitializeComponent();
            label1.Parent = pictureBox1;
            label1.BackColor = Color.Transparent;
            label2.Parent = pictureBox1;
            label2.BackColor = Color.Transparent;
            label3.Parent = pictureBox1;
            label3.BackColor = Color.Transparent;
            label4.Parent = pictureBox1;
            label4.BackColor = Color.Transparent;
            label5.Parent = pictureBox1;
            label5.BackColor = Color.Transparent;

            version.Parent = pictureBox1;
            version.BackColor = Color.Transparent;
            lblbuilddate.Parent = pictureBox1;
            lblbuilddate.BackColor = Color.Transparent;

            version.Text = "Version " + Application.ProductVersion;
            lblbuilddate.Text = "Build Date: " + Utility.RetrieveLinkerTimestamp().ToString();

            LoadPluginSplash();
            m_timer = new Timer();
            m_timer.Interval = 20;
            m_timer.Tick += new EventHandler(m_timer_Tick);
            m_timer.Start();

            Opacity = 0.0;
        }
开发者ID:tojoevan,项目名称:BGC-CW,代码行数:30,代码来源:frmSplash.cs

示例6: Form1

        public Form1()
        {
            InitializeComponent();
            ControlledProcess = new Process();
            Temperature = new TemperatureWorker(1000);      //refresh time = 1000ms
            TimerInt =  new Timer();
            TimerInt.Interval = 1000;
            TimerInt.Tick += new EventHandler(timer_tick);
            TimerInt.Start();

            statusStrip1.Text = "statusStrip1";
            statusStrip1.Items.Add("Core 1:");
            statusStrip1.Items[0].AutoSize = false;
            statusStrip1.Items[0].Size = new Size(statusStrip1.Width / 5, 1);

            statusStrip1.Items.Add("Core 2:");
            statusStrip1.Items[1].AutoSize = false;
            statusStrip1.Items[1].Size = new Size(statusStrip1.Width / 5, 1);

            statusStrip1.Items.Add("Core 3:");
            statusStrip1.Items[2].AutoSize = false;
            statusStrip1.Items[2].Size = new Size(statusStrip1.Width / 5, 1);

            statusStrip1.Items.Add("Core 4:");
            statusStrip1.Items[3].AutoSize = false;
            statusStrip1.Items[3].Size = new Size(statusStrip1.Width / 5, 1);
        }
开发者ID:MohiuddinM,项目名称:TemperatureMonitor,代码行数:27,代码来源:Form1.cs

示例7: MainForm_Load

 /// <summary>
 /// フォームのロード時
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MainForm_Load(object sender, EventArgs e)
 {
     m_timer = new Timer();
     m_timer.Tick += this.timerTickHandler;
     m_timer.Interval = this.calcInterval();
     m_timer.Start();
 }
开发者ID:kurose,项目名称:BreakAlert,代码行数:12,代码来源:MainForm.cs

示例8: StatusBar

 public StatusBar()
 {
     _timer = new Timer();
     _timer.Interval = 900;
     _timer.Tick += OnTimerTick;
     _timer.Start();
 }
开发者ID:Danielku15,项目名称:WeTabLock,代码行数:7,代码来源:StatusBar.cs

示例9: btnGenerate_Click

        private void btnGenerate_Click(object sender, EventArgs e)
        {
            Description fileHeader = new Description(txtProgramName.Text,txtProgramName.Text,txtAuthorName.Text,txtDescription.Text);
            fileHeader.GenerateOutput( this.getFillerCharacter() );

            Clipboard.SetText( fileHeader.Output );

            lblStatus.ForeColor = SystemColors.ControlText;

            Output popup = new Output();
            popup.Show();
            popup.txtOutput.Text = fileHeader.Output;

            Timer fadeTimer = new Timer();
            int i = 0;

            fadeTimer.Interval = 1500;
            fadeTimer.Tick += (sa, aeaa) =>
            {
                fadeTimer.Interval = 10;
                i++;

                lblStatus.ForeColor = Program.Lerp(SystemColors.ControlText, SystemColors.Control, (float)i / 100.0f);

                lblStatus.Invalidate();

                if (i == 100 )
                {
                    fadeTimer.Stop();
                }
            };

            fadeTimer.Start();
        }
开发者ID:ndbeals,项目名称:description-generator,代码行数:34,代码来源:UserInput.cs

示例10: ShowData

        public void ShowData()
        {
            if (dataShowed) return;
            dataShowed = true;

            // timer
            timerRefresh = new Timer();
            timerRefresh.Interval = 5000;
            timerRefresh.Tick += TimerRefresh;
            timerRefresh.Start();

            for (int i = 0; i < 3; i++)
            {
                FlowLayoutPanel panel = new FlowLayoutPanel();

                panel.Dock = DockStyle.Fill;
                this.panelClient.Controls.Add(panel);
                monitorNavs[i] = panel;
            }

            // now only process Normal
            foreach (Monitor monitor in strategy.GetMonitorEnumerator())
            {
                MonitorUC uc = new MonitorUC(monitor);
                uc.Parent = this;

                flowLayoutPanel1.Controls.Add(uc);
                monitorNavs[monitor.Category].Controls.Add(uc);

            }

            // default is Observe Nav
            btnObserve_Click(this, null);
        }
开发者ID:jiangyimin,项目名称:QTP,代码行数:34,代码来源:MonitorOverviewUC.cs

示例11: btn_BLKWHTAUTO_Click

        private void btn_BLKWHTAUTO_Click(object sender, EventArgs e)
        {
            //:Let them know this is a larger operation.
              this.Text = "Please be patient, this is a larger comparison.";

              //:We do NOT want them clicking while the thread is running.
              ButtonsEnabled(false);
              btn_Refresh.Enabled    = false;
              btn_newIMG.Enabled     = false;
              btn_Export.Enabled     = false;
              btn_GRYSCL.Enabled     = false;
              btn_BLKWHT.Enabled     = false;
              nud_BWSCALE.Enabled    = false;
              btn_BLKWHTAUTO.Enabled = false;
              ready = false; //:Not ready to continue other functions. [excluding this]

              //:Start a timer along with a thread to multithread the process gargling AutoBW
              System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();
              t.Interval = 1000;
              t.Tick += new EventHandler(t_Tick);

              Thread th = new Thread(new ThreadStart(BWAUTO_TH));
              t.Start();
              th.Start();
        }
开发者ID:Theta-Z,项目名称:Basic-Stuff,代码行数:25,代码来源:Form1.cs

示例12: ToolTabs

        public ToolTabs()
        {
        	toolStrip.BackColor = Program.Conf.BgColor;
        	toolStrip.ForeColor = Program.Conf.TextColor;
            BackColor = Program.Conf.BgColor; //for any child control to inherit it
            ForeColor = Program.Conf.TextColor;

            //set colour for overflow button:
            var ovrflwBtn = toolStrip.OverflowButton;
            ovrflwBtn.BackColor = Color.DimGray; //note: the colour of arrow on OverFlow button can't be set, that's why we couldn't use User's theme

            Controls.Add(panel);
            Controls.Add(toolStrip);

            var timer = new Timer { Interval = 1000 };

            timer.Tick += (s, e) =>
                {
                    foreach (var button in toolStrip.Items.OfType<ToolStripButton>())
                    {
                        if (button.Tag is HiliteLevel && ((HiliteLevel)button.Tag) == HiliteLevel.Flash) button.BackColor = button.BackColor == Color.SkyBlue ? Color.Empty : Color.SkyBlue;
                    }
                };

            timer.Start();
        }
开发者ID:TurBoss,项目名称:Zero-K-Infrastructure,代码行数:26,代码来源:ToolTabs.cs

示例13: MainForm_Load

        private void MainForm_Load(Object sender, EventArgs e)
        {
            // bind connection Strings to the dropdown lists
            cboPersistenceService.DisplayMember = "Name";
            cboTrackingService.DisplayMember = "Name";
            foreach (ConnectionStringSettings connectionStringSetting in ConfigurationManager.ConnectionStrings)
            {
                cboPersistenceService.Items.Add(connectionStringSetting);
                cboTrackingService.Items.Add(connectionStringSetting);
            }

            cboTrackingService.Items.Insert(0, "None");

            if (cboPersistenceService.Items.Count > 0)
                cboPersistenceService.SelectedIndex = 0;

            if (cboTrackingService.Items.Count > 0)
                cboTrackingService.SelectedIndex = 0;

            // configure delegate trace listener
            DelegateTraceListener traceListener = new DelegateTraceListener();
            traceListener.WriteDelegate += traceListener_WriteDelegate;
            traceListener.WriteLineDelegate += traceListener_WriteDelegate;
            Trace.Listeners.Add(traceListener);

            // and the timer to flush messages to the message box
            traceDelegate = traceToMessageBox;
            timer = new Timer();
            timer.Interval = 1000;
            timer.Tick += timer_Tick;
            timer.Start();
        }
开发者ID:JuRogn,项目名称:OA,代码行数:32,代码来源:MainForm.cs

示例14: InitTimer

 private void InitTimer()
 {
     timer = new Timer();
     timer.Tick += new EventHandler(btnUpdateAPI_Click);
     timer.Interval = Convert.ToInt32(txtRefreshRate.Text) * 60000;
     timer.Start();
 }
开发者ID:C222,项目名称:BattleRoyaleStatsApp,代码行数:7,代码来源:Form1.cs

示例15: UploadForm

        public UploadForm(bool keepAlive, Rectangle canvas)
        {
            InitializeComponent();

            this.ResizeRedraw = true;

            Main.Panel1Collapsed = !keepAlive;
            int height = keepAlive ? 23 : 0;
            Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            UploadSettingsConfigSection section = (UploadSettingsConfigSection)configuration.GetSection("UploadSettings");
            if (section != null) {
                foreach (UploadElement uploadElement in section.UploadSettings) {
                    UploadPanel panel = new UploadPanel();
                    panel.BackColor = Color.FromArgb(uploadElement.Color);
                    panel.Dock = DockStyle.Top;
                    panel.Height = 50;
                    panel.Width = 100;
                    panel.Upload += new UploadAction(panel_Upload);
                    panel.Description = uploadElement.Description;
                    Main.Panel2.Controls.Add(panel);
                    height += 50;
                }
            }

            SetDesktopBounds(canvas.Right - 150, canvas.Bottom - height, 100, height);

            fadeTimer = new Timer();
            fadeTimer.Interval = 5000;
            fadeTimer.Tick += new EventHandler(fadeTimer_Tick);
            if (!keepAlive)
                fadeTimer.Start();
        }
开发者ID:Maklar,项目名称:FileDistributorClient,代码行数:32,代码来源:UploadForm.cs


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