private int m_failed = 0;//连续异常三次则报警 //定时器 private void TimerInitialization() { timer = new Timer(); timer.Interval = 1000; timer.Tick += Timer_Tick; //timer.Start(); }
public void InitTimer() { timer1 = new Timer(); timer1.Tick += new EventHandler(timer1_Tick); timer1.Interval = 1000; // in miliseconds timer1.Start(); }
private void Form4_Load(object sender, EventArgs e) { t = new System.Windows.Forms.Timer(); t.Interval = 1; //1second t.Tick += new EventHandler(t_Tick); t.Enabled = true; }
private void Form1_Load(object sender, EventArgs e) { Timer timer = new System.Windows.Forms.Timer(); timer.Interval = (1000); timer.Tick += new EventHandler(timer1_Tick); timer.Start(); }
private void Form1_Load(object sender, EventArgs e) { t1 = new Thread(new ThreadStart(socketSendReceive)); //t1.IsBackground = true; t1.Start(); //타이머 뛸 때마다 다시 그리도록 작성한다 T = new Timer(); T.Interval = 500; T.Tick += new EventHandler(Form1_Timer); T.Start(); }
public ucUI() { Thread.CurrentThread.CurrentUICulture = new CultureInfo(CultureInfo.CurrentCulture.LCID); InitializeComponent(); AddOpenGLControl(); if (!GLSettings.IsInitializedFromSettings) { GLSettings.InitFromSettings(); } this.Height = GLSettings.Height; this.Width = GLSettings.Width; this.Text = "UI"; Timer timer = new System.Windows.Forms.Timer() { Interval = 1000, }; timer.Tick += Tick; timer.Enabled = true; }
private void button1_Click(object sender, EventArgs e) { Task uninst = new Task(() => { try { ForceDelete(ConexionLib.FachadaRegistro.RutaPrograma()); } catch (Exception) { } try { ConexionLib.FachadaRegistro.EliminarConfiguracion(); } catch (Exception) { } try { ConexionLib.FachadaRegistro.DesregistrarPrograma(); } catch (Exception) { } try { ConexionLib.FachadaRegistro.DesregistrarDesinstalador(); } catch (Exception) { } }); Timer t = new System.Windows.Forms.Timer { Interval = 5 }; UnKilledLines = new List <int>(); for (int y = 0; y < pictureBox1.Image.Height; y++) { UnKilledLines.Add(y); } Random r = new Random(); t.Tick += (a, b) => { if (UnKilledLines.Count < 1 && uninst.Status == TaskStatus.RanToCompletion) { t.Stop(); MessageBox.Show("Gracias por usar SLTA"); this.Close(); } if (UnKilledLines.Count > 0) { int idx = r.Next(UnKilledLines.Count); var line = UnKilledLines[idx]; UnKilledLines.RemoveAt(idx); if (!(pictureBox1.Image is Bitmap bmp)) { pictureBox1.Image = new Bitmap(pictureBox1.Image); bmp = (Bitmap)pictureBox1.Image; } for (int x = 0; x < pictureBox1.Image.Width; x++) { bmp.SetPixel(x, line, Color.Red); } pictureBox1.Image = bmp; } }; uninst.Start(); t.Start(); }
private void InitializeEditingManager() { _editingManager = new BlogPostEditingManager( this, new IBlogPostEditor[] { _htmlEditor, this }, _htmlEditor ); commandPluginsGallery = (GalleryCommand<string>)CommandManager.Get(CommandId.PluginsGallery); commandPluginsGallery.StateChanged += new EventHandler(commandPluginsGallery_StateChanged); _editingManager.BlogChanged += new EventHandler(_editingManager_BlogChanged); _editingManager.BlogSettingsChanged += new WeblogSettingsChangedHandler(_editingManager_BlogSettingsChanged); _editingManager.EditingStatusChanged += new EventHandler(_editingManager_EditingStatusChanged); _editingManager.UserSavedPost += new EventHandler(_editingManager_UserSavedPost); _editingManager.UserPublishedPost += new EventHandler(_editingManager_UserPublishedPost); _editingManager.UserDeletedPost += new EventHandler(_editingManager_UserDeletedPost); // initialize auto-save timer _autoSaveTimer = new System.Windows.Forms.Timer(this.components); _autoSaveTimer.Interval = 5000; _autoSaveTimer.Tick += new EventHandler(_autoSaveTimer_Tick); _autoSaveMessageDismissTimer = new Timer(components); _autoSaveMessageDismissTimer.Interval = 450; _autoSaveMessageDismissTimer.Tick += _autoSaveMessageDismissTimer_Tick; }
private void StartExtractingClick(object sender, EventArgs e) { if (this.progressTimer != null) { if (this.progressTimer.Enabled) { MessageBox.Show("Cannot perform 2 actions at once"); return; } } if (!(this.StartExtracting.Text.Equals(StopLabel))) { if (this.TestAssetsFolder()) { if (String.IsNullOrWhiteSpace(StaticStorage.settings.CustomExtractPath)) { if (StaticStorage.settings.ShowExtractProblem) { DialogResult dialogResult = MessageBox.Show("No custom extract folder chosen. The files will be extracted to " + Path.Combine(StaticStorage.settings.AssetsFolder, "extract") + "\n\nWould you like to continue? (If yes, then this message will not be displayed anymore)", "Extract Folder problem", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { StaticStorage.settings.ShowExtractProblem = false; this.SaveSettings(); } else if (dialogResult == DialogResult.No) { return; } } } this.StartExtracting.Text = StopLabel; this.ExtractAllBox.Enabled = false; this.SingleBundleCheck.Enabled = false; this.ListBox1.Enabled = false; this.RenameTexture.Enabled = false; this.XMLExtensions.Enabled = false; this.BikExtensions.Enabled = false; this.SingleBundleText.Enabled = false; this.ExtractFolderButton.Enabled = false; this.ListData.Enabled = false; this.ListLogBox.Enabled = false; TextWriteLine("StartBundle"); this.ProgressLabel.Text = "Progress: 0/0"; this.progressBar1.Value = 0; //StartBundle(); ExtractTimer = new System.Windows.Forms.Timer(); ExtractTimer.Interval = 100; ExtractTimer.Tick += this.UpdateProgressTick; ExtractTimer.Enabled = true; ExtractTimer.Start(); StaticStorage.extract.Finished = false; StaticStorage.extract.MainEnabled = true; //bundleThread = new Thread(() => { StaticStorage.extract.StartBundle(); ThreadEnd(); }); bundleThread = new Thread(() => StaticStorage.extract.Start()); bundleThread.IsBackground = true; bundleThread.Start(); //this.StartExtracting.Enabled = true; //MessageBox.Show("Job Finished."); } else { MessageBox.Show("Assets folder not valid"); TextWriteLine("Assets folder not valid"); } } else { FinishExtract(); } }