/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 10; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // timer2 // this.timer2.Interval = 10; this.timer2.Tick += new System.EventHandler(this.timer2_Tick); // // Frm_Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImage = global::MoveForm.Properties.Resources.星星图; this.ClientSize = new System.Drawing.Size(320, 91); this.Name = "Frm_Main"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "使用Timer组件制作左右飘动的窗体"; this.ResumeLayout(false); }
/// <summary> /// デザイナ サポートに必要なメソッドです。このメソッドの内容を /// コード エディタで変更しないでください。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // pictureBox1 // this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click); // // timer1 // this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // Substrate // this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.Controls.Add(this.pictureBox1); this.DoubleBuffered = true; this.MaximizeBox = false; this.Name = "Substrate"; this.Text = "Substrate"; this.Resize += new System.EventHandler(this.Substrate_Resize); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); }
private void StartTimer(int interval) { System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = interval; timer.Tick += new EventHandler(Timer_Tick); timer.Enabled = true; }
public Media() { timer1 = new System.Windows.Forms.Timer(); timer1.Enabled = false; timer1.Interval = 100; timer1.Tick += new System.EventHandler(this.timer1_Tick); }
public SledSyntaxCheckerService(ISettingsService settingsService) { Enabled = true; Verbosity = SledSyntaxCheckerVerbosity.Overall; var enabledProp = new BoundPropertyDescriptor( this, () => Enabled, "Enabled", null, "Enable or disable the syntax checker"); var verboseProp = new BoundPropertyDescriptor( this, () => Verbosity, "Verbosity", null, "Verbosity level"); // Persist settings settingsService.RegisterSettings(this, enabledProp, verboseProp); // Add user settings settingsService.RegisterUserSettings("Syntax Checker", enabledProp, verboseProp); m_syncContext = SynchronizationContext.Current; m_batchTimer = new Timerz { Interval = TimerIntervalMsec }; m_batchTimer.Tick += BatchTimerTick; m_batchTimer.Start(); }
/// <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.lbContacts = new System.Windows.Forms.ListBox(); this.label1 = new System.Windows.Forms.Label(); this.btnStartChat = new System.Windows.Forms.Button(); this.chatCheckTimer = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // lbContacts // this.lbContacts.FormattingEnabled = true; this.lbContacts.Location = new System.Drawing.Point(12, 25); this.lbContacts.Name = "lbContacts"; this.lbContacts.Size = new System.Drawing.Size(207, 290); this.lbContacts.TabIndex = 0; this.lbContacts.SelectedIndexChanged += new System.EventHandler(this.lbContacts_SelectedIndexChanged); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(12, 9); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(49, 13); this.label1.TabIndex = 1; this.label1.Text = "Contacts"; // // btnStartChat // this.btnStartChat.Location = new System.Drawing.Point(225, 25); this.btnStartChat.Name = "btnStartChat"; this.btnStartChat.Size = new System.Drawing.Size(106, 23); this.btnStartChat.TabIndex = 2; this.btnStartChat.Text = "Start Chat"; this.btnStartChat.UseVisualStyleBackColor = true; this.btnStartChat.Click += new System.EventHandler(this.btnStartChat_Click); // // chatCheckTimer // this.chatCheckTimer.Enabled = true; this.chatCheckTimer.Interval = 2000; this.chatCheckTimer.Tick += new System.EventHandler(this.chatCheckTimer_Tick); // // HoofdForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(340, 327); this.Controls.Add(this.btnStartChat); this.Controls.Add(this.label1); this.Controls.Add(this.lbContacts); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.Name = "HoofdForm"; this.Text = "HoofdForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.HoofdForm_FormClosing); this.ResumeLayout(false); this.PerformLayout(); }
public Service1() { InitializeComponent(); timer = new System.Windows.Forms.Timer(); timer.Interval = Settings.GetValue("MailSchedulerInterval"); timer.Tick += timer_Tick; }
/// <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.itemsPanel = new System.Windows.Forms.Panel(); this.animationTimer = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // itemsPanel // this.itemsPanel.Anchor = System.Windows.Forms.AnchorStyles.None; this.itemsPanel.Location = new System.Drawing.Point(3, 3); this.itemsPanel.Name = "itemsPanel"; this.itemsPanel.Size = new System.Drawing.Size(166, 104); this.itemsPanel.TabIndex = 0; // // animationTimer // this.animationTimer.Enabled = true; this.animationTimer.Interval = 50; this.animationTimer.Tick += new System.EventHandler(this.AnimationTick); // // CustomListBox // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Controls.Add(this.itemsPanel); this.DoubleBuffered = true; this.Name = "CustomListBox"; this.Size = new System.Drawing.Size(172, 110); this.ResumeLayout(false); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.taskMgrTimer = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // taskMgrTimer // this.taskMgrTimer.Enabled = true; this.taskMgrTimer.Interval = 250; this.taskMgrTimer.Tick += new System.EventHandler(this.TaskMgrTimerTick); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 262); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "MainForm"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "PeskyKidsSD"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormFormClosing); this.Load += new System.EventHandler(this.MainFormLoad); this.Click += new System.EventHandler(this.MainFormClick); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainFormKeyDown); this.ResumeLayout(false); }
/// <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.movementTimer = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // movementTimer // this.movementTimer.Enabled = true; this.movementTimer.Interval = 1; this.movementTimer.Tick += new System.EventHandler(this.movementTimer_Tick); // // Notifier // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(116, 12); this.DoubleBuffered = true; this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "Notifier"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Toast Notifier"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Notifier_FormClosed); this.Click += new System.EventHandler(this.Notifier_Click); this.Paint += new System.Windows.Forms.PaintEventHandler(this.Notifier_Paint); this.MouseEnter += new System.EventHandler(this.Notifier_MouseEnter); this.MouseLeave += new System.EventHandler(this.Notifier_MouseLeave); this.ResumeLayout(false); }
/** * @param target_pos target position for each point in Polygon * @param frame_count number of frame that construct the tweening */ public void tweening(int[,] start_pos, int[,] target_pos, double progress, Callback callback) { if (target_pos.GetLength(0) < this.vertices.GetLength(0) || (progress < 0 || progress > 1)) { Console.WriteLine("[Debug] Tweening failed, new points length not match." + progress); return; } for (int i = 0; i < this.vertices.GetLength(0); i++) { double x = ((1 - progress) * start_pos[i, 0] + (progress * target_pos[i, 0])); double y = ((1 - progress) * start_pos[i, 1] + (progress * target_pos[i, 1])); Console.WriteLine("[" + i + "] " + x + ", " + y); this.vertices[i].translate((int)x, (int)y, false); } callback(); return; System.Windows.Forms.Timer timr = new System.Windows.Forms.Timer(); timr.Tick += (sender, e) => { for (int i = 0; i < this.vertices.GetLength(0); i++) { int x = (int) ((1 - progress) * target_pos[i, 0] + (progress * start_pos[i, 0])); int y = (int) ((1 - progress) * target_pos[i, 1] + (progress * start_pos[i, 1])); this.vertices[i].translate(x, y, false); } }; timr.Interval = 50; timr.Start(); }
public ExplosionParticleEmitter(int numParticles) { MaxParticleCount = numParticles; MainTimer = new Timer(); MainTimer.Tick += AnimationStep; MainTimer.Interval = 10; Scale = 0.5f; Gravity = new Vector(0.0f, 0.0f, 0.0f); ExplosionDuration = 70; FadeOutDuration = 500; StartingColor = Color.FromArgb(255, Color.Orange); EndColor = Color.FromArgb(128, Color.Red); SmokeColor = Color.FromArgb(0, Color.Black); Particles = new List<RectangleParticle>(); float z = 0.0f; for (int i = 0; i < MaxParticleCount; ++i) { //here we set the constant values of our particle var temp = new RectangleParticle(this); temp.AnimationTime = 10; temp.Location.Z = z; temp.Texture = defaultTexture; Particles.Add(temp); z += 0.1f; } }
public MainWindow() { InitializeComponent(); // Display current date and time txtDateTime.Text = DateTime.Now.ToString("MMM dd, yyyy HH:MM:ss"); var tmr = new System.Windows.Forms.Timer(); tmr.Interval = 1000; tmr.Tick += (object sender, EventArgs e) => { txtDateTime.Text = DateTime.Now.ToString("MMM dd, yyyy HH:MM:ss"); }; tmr.Enabled = true; txt1.Text = "Fajr"; txt2.Text = "Sunrise"; txt3.Text = "Dhuhur"; txt4.Text = "Asr"; txt5.Text = "Maghrib"; txt6.Text = "Isha"; box1.Text = "05:03"; box2.Text = "05:03"; box3.Text = "05:03"; box4.Text = "05:03"; box5.Text = "05:03"; box6.Text = "05:03"; }
/// <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.zedGraphControl1 = new ZedGraph.ZedGraphControl(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // zedGraphControl1 // this.zedGraphControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.zedGraphControl1.Location = new System.Drawing.Point(0, 0); this.zedGraphControl1.Name = "zedGraphControl1"; this.zedGraphControl1.ScrollGrace = 0D; this.zedGraphControl1.ScrollMaxX = 0D; this.zedGraphControl1.ScrollMaxY = 0D; this.zedGraphControl1.ScrollMaxY2 = 0D; this.zedGraphControl1.ScrollMinX = 0D; this.zedGraphControl1.ScrollMinY = 0D; this.zedGraphControl1.ScrollMinY2 = 0D; this.zedGraphControl1.Size = new System.Drawing.Size(872, 372); this.zedGraphControl1.TabIndex = 0; // // DeltaGraphcs // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(872, 372); this.Controls.Add(this.zedGraphControl1); this.Name = "DeltaGraphcs"; this.Text = "DeltaGraphcs"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.DeltaGraphcs_FormClosed); this.Resize += new System.EventHandler(this.DeltaGraphcs_Resize); this.ResumeLayout(false); }
public DebrisParticleEmitter(int numParticles) { MaxParticleCount = numParticles; Particles = new List<RectangleParticle>(); Gravity = new Vector(0f, -.5f, 0f); ; MainTimer = new Timer(); MainTimer.Tick += AnimationStep; MainTimer.Interval = 10; Scale = 0.5f; ExplosionDuration = 100; StartingColor = Color.FromArgb(255, Color.Orange); EndColor = Color.FromArgb(255, Color.DarkGray); Particles = new List<RectangleParticle>(); for (int i = 0; i < MaxParticleCount; ++i) { //here we set the constant values of our particle var temp = new RectangleParticle(this); temp.Size.X = particleSize.X; temp.Size.Y = particleSize.Y; temp.AnimationTime = 10; temp.TargetColor = EndColor; temp.Texture = images[GeneralMath.RandomInt() % images.Length]; Particles.Add(temp); } }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.LookAtOptions = new System.Windows.Forms.Timer(this.components); this.multicastListener1 = new WithClickOnceLANLauncherShared.MulticastListenerComponent(); this.multicastSend1 = new WithClickOnceLANLauncherShared.MulticastSendComponent(); // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 500; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // LookAtOptions // this.LookAtOptions.Enabled = true; this.LookAtOptions.Interval = 2000; this.LookAtOptions.Tick += new System.EventHandler(this.LookAtOptions_Tick); // // multicastListener1 // this.multicastListener1.AtData += new System.Action<string>(this.multicastListener1_AtData); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { components = new System.ComponentModel.Container(); tmrApp = new System.Windows.Forms.Timer(components) { Interval = 2, Enabled = true }; SuspendLayout(); // // tmrApp // tmrApp.Tick += new System.EventHandler(tmrApp_Tick); // // Maze_Form // AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; BackColor = System.Drawing.Color.FromArgb(31,31,31); ClientSize = new System.Drawing.Size(484, 461); DoubleBuffered = true; KeyPreview = true; Name = "MazeForm"; Text = "Maze AI"; Load += new System.EventHandler(Form1_Load); Paint += new System.Windows.Forms.PaintEventHandler(Form1_Paint); KeyDown += new System.Windows.Forms.KeyEventHandler(Form1_KeyDown); MouseClick += new System.Windows.Forms.MouseEventHandler(Form1_LeftClick); MouseMove += new System.Windows.Forms.MouseEventHandler(Form1_MouseMove); Resize += new System.EventHandler(Form1_Resize); Shown += new System.EventHandler(OnShow); ResumeLayout(false); }
public void Open() { try { bool isConnected = FindTheHid(vendorId, productId); if (isConnected) { Tracer.Trace("OK: USB Interface connected with PIC USB Proximity Board"); } else { string str = string.Format("USB Interface could not connect with device with Vendor ID={0} Product ID={1}", vendorId, productId); Tracer.Error(str); throw new Exception(str); } // run a monitoring thread in case we need to reset things: picUsbTickerTimer = new System.Windows.Forms.Timer(); picUsbTickerTimer.Interval = 1000; // ms picUsbTickerTimer.Tick += new EventHandler(picUsbTicker); picUsbTickerTimer.Start(); Tracer.Trace("OK: PIC Proximity Board ticker ON"); } catch (Exception ex) { Tracer.Error(ex); throw; } }
public ATimer(int timerType, int intervalMS, ElapsedTimerDelegate callback) { _timerType = timerType; _interval = intervalMS; _elapsedTimerHandler = callback; if (timerType == 0) { _elapsedTimer0Handler = Timer0Handler; } else if (timerType == 1) { _elapsedTimer1Handler = Timer1Handler; _timer1 = new System.Windows.Forms.Timer(); _timer1.Interval = _interval; _timer1.Tick += Timer1Handler; } else if (timerType == 2) { _timer2 = new MicroTimer(); _timer2.Interval = _interval * 1000; _timer2.MicroTimerElapsed += Timer2Handler; } else if (timerType == 3) { } }
public bool ShowPage(string url) { // we use winforms timers to avoid invoking UI actions from background threads, etc. openPageTimer = CreateTimer(() => OpenPage(url), 1); return true; }
void SplashWindow_ContentRendered(object sender, EventArgs e) { System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 5000; timer.Tick += timer_Tick; timer.Enabled = true; }
public GameMultiplayerControl(Control Control, GameScreen GameScreen, int MapIndex, int SaveGameIndex, MultiplayerMatchStartInformation MP) : base(Control, GameScreen, MapIndex, SaveGameIndex, true) { this.UserName = MP.UserName; this.Password = MP.Password; this.MatchId = MP.MatchId; this.GameState = 0; this.MultiplayerMatch = true; this.MultiplayerFraction = MP.MultiplayerFraction; // timer checking if a newer game state is available NewGameStateAvailableTimer = new System.Windows.Forms.Timer(); NewGameStateAvailableTimer.Interval = 1000; NewGameStateAvailableTimer.Tick += UpdateGameState; NewGameStateAvailableTimer.Start(); // show multiplayer tab (gui) and update it's content GameScreen.TabItem_Multiplayer.Visibility = Visibility.Visible; GameScreen.Button_Restart.IsEnabled = false; // disable restart map button for multiplayer matches GameScreen.Label_Multiplayer_MatchID.Content = R.String("MatchID") + ": " + MatchId.ToString(); GameScreen.Label_Multiplayer_MatchVersion.Content = R.String("MatchVersion") + ": " + GameState.ToString(); // background worker BackgroundWorkerDownloadLatestGameState.DoWork += BackgroundWorkerDownloadLatestGameStateWork; BackgroundWorkerDownloadLatestGameState.RunWorkerCompleted += BackgroundWorkerDownloadLatestGameState_RunWorkerCompleted; }
/// <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.timer1 = new System.Windows.Forms.Timer(this.components); this.img1 = new reSize.Img(); this.SuspendLayout(); // // timer1 // this.timer1.Interval = 1000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // img1 // this.img1.BackColor = System.Drawing.Color.Transparent; this.img1.Location = new System.Drawing.Point(64, 32); this.img1.Name = "img1"; this.img1.Size = new System.Drawing.Size(153, 192); this.img1.TabIndex = 1; this.img1.Text = "img1"; this.img1.DoubleClick += new System.EventHandler(this.img1_DoubleClick); // // face // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.ClientSize = new System.Drawing.Size(292, 273); this.Controls.Add(this.img1); this.Name = "face"; this.Text = "双击选框进行裁剪"; this.Load += new System.EventHandler(this.face_Load); this.ResumeLayout(false); }
private void InitTimer1() { var _timer1 = new System.Windows.Forms.Timer(); _timer1.Tick += new EventHandler(timer1_Tick); _timer1.Interval = 1000; // in miliseconds _timer1.Start(); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Load)); this.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 5000; this.timer1.Tick += new System.EventHandler(this.Timer1Tick); // // Load // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.ClientSize = new System.Drawing.Size(700, 210); this.Cursor = System.Windows.Forms.Cursors.WaitCursor; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Load"; this.Opacity = 0.95D; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Load"; this.TransparencyKey = System.Drawing.Color.Transparent; this.UseWaitCursor = true; this.Load += new System.EventHandler(this.LoadLoad); this.ResumeLayout(false); }
/// <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.label1 = new System.Windows.Forms.Label(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.label2 = new System.Windows.Forms.Label(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(25, 21); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(35, 13); this.label1.TabIndex = 0; this.label1.Text = "label1"; // // progressBar1 // this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.progressBar1.Location = new System.Drawing.Point(28, 46); this.progressBar1.Name = "progressBar1"; this.progressBar1.Size = new System.Drawing.Size(230, 23); this.progressBar1.Step = 1; this.progressBar1.TabIndex = 1; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(34, 76); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(35, 13); this.label2.TabIndex = 2; this.label2.Text = "label2"; // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 500; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // frmProgress // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(284, 98); this.Controls.Add(this.label2); this.Controls.Add(this.progressBar1); this.Controls.Add(this.label1); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "frmProgress"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Progress"; this.Load += new System.EventHandler(this.frmProgress_Load); this.ResumeLayout(false); this.PerformLayout(); }
public TvNotifyManager() { using (Settings xmlreader = new MPSettings()) { _enableRecNotification = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false); _preNotifyConfig = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300); } _busy = false; _timer = new Timer(); _timer.Stop(); // check every 15 seconds for notifies _dummyuser = new User(); _dummyuser.IsAdmin = false; _dummyuser.Name = "Free channel checker"; _timer.Interval = 15000; _timer.Enabled = true; // Execute TvNotifyManager in a separate thread, so that it doesn't block the Main UI Render thread when Tvservice connection died new Thread(() => { _timer.Tick += new EventHandler(_timer_Tick); } ) {Name = "TvNotifyManager"}.Start(); _notifiedRecordings = new ArrayList(); }
/// <summary> /// Schedules action to be executed after dueTime on the message loop associated with the control. /// </summary> public IDisposable Schedule(Action action, TimeSpan dueTime) { if (action == null) throw new ArgumentNullException("action"); var dt = Scheduler.Normalize(dueTime); var time = (int)dt.TotalMilliseconds; if (time == 0) return Schedule(action); System.Windows.Forms.Timer timer = null; Control.Invoke(new Action(() => { timer = new System.Windows.Forms.Timer(); timer.Tick += (s, e) => { var t = timer; if (t != null) t.Enabled = false; timer = null; action(); }; timer.Interval = time; timer.Enabled = true; })); return new AnonymousDisposable(() => { var t = timer; if (t != null) t.Enabled = false; timer = null; }); }
/// <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.timer1 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // timer1 // this.timer1.Enabled = true; this.timer1.Interval = 2600; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // Pochetna // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLight; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.ClientSize = new System.Drawing.Size(864, 674); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "Pochetna"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Pochetna_FormClosed); this.Load += new System.EventHandler(this.Pochetna_Load); this.Paint += new System.Windows.Forms.PaintEventHandler(this.Pochetna_Paint); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Pochetna_MouseDown); this.ResumeLayout(false); }
public SMSManager(Char receivingProjectCode, Char receivingProgramCode) { // check project code and program code availability. if (!arrayContains(usableCharset, receivingProjectCode)) throw new ArgumentException("Project Code needs to be within accepted Charset"); if (!arrayContains(usableCharset, receivingProgramCode)) throw new ArgumentException("Program Code needs to be within accepted Charset"); this.receivingProjectCode = receivingProjectCode; this.receivingProgramCode = receivingProgramCode; resendTimer = new System.Windows.Forms.Timer(); /* Adds the event and the event handler for the method that will process the timer event to the timer. */ resendTimer.Tick += new EventHandler(ResendFailedToSentMsgs); // Timer runs every 10 minutes. resendTimer.Interval = resendCheckInterval; resendTimer.Enabled = true; unfinishedSentMsgList = new Dictionary<String, SentMessage>(); // create monitoring thread smsSendingMonitorThread = new Thread(new ThreadStart(smsSendingMonitor)); smsSendingMonitorThread.Start(); }
private void OpenPage(string url) { openPageTimer.Stop(); openPageTimer = null; try { var window = dte.ItemOperations.Navigate(url, vsNavigateOptions.vsNavigateOptionsNewWindow); window.Activate(); activationTimer = CreateTimer(() => ActivateWindow(window), 4); } catch (Exception) { // bad luck... } }
public SnowWindow() { WindowState = System.Windows.Forms.FormWindowState.Maximized; Text = "Merry Christmas!"; TopLevel = true; TopMost = true; _timer = new System.Windows.Forms.Timer() { Interval = 1000, Enabled = true, }; _timer.Tick += (o, e) => CreateSnow(); _musicPath = GetMusicPath(); mciSendString($"open {_musicPath} type sequencer alias music", null, 0, Handle); PlayMusic(); }
private bool FreeDiskSpace(string vm) { Logger.Info("In FreeDiskSpace"); AdbCommandRunner runner = new AdbCommandRunner(vm); try { if (!runner.Connect(vm)) { Logger.Warning("Cannot connect to guest"); return(false); } if (!runner.RunShellPrivileged("stop")) { return(false); } runner.RunShellPrivileged("swapoff /data/swap_space"); Thread.Sleep(2000); if (!runner.RunShellPrivileged("mount -o remount,ro /data")) { return(false); } this.ParentWindow.UpdateProgress(30.0); this.ParentWindow.Dispatcher.Invoke((Delegate)(() => { this.progressTimer = new System.Windows.Forms.Timer(); this.progressTimer.Tick += new EventHandler(this.ProgressTimer_Tick); this.progressTimer.Interval = 6000; this.progressTimer.Start(); })); if (!this.RunZeroFreeAndroid(runner)) { return(false); } } catch (Exception ex) { Logger.Error("Error in freeing disk space err:" + ex.ToString()); return(false); } finally { runner.Dispose(); } return(true); }
private void Window_Loaded(object sender, RoutedEventArgs e) { UnrealScienceScripting.SetPlaying(); unsafe { UnrealScienceScripting.InitD3D(panel.Handle.ToPointer(), System.Windows.Forms.SystemInformation.VirtualScreen.Width, System.Windows.Forms.SystemInformation.VirtualScreen.Height); loaded = true; } UnrealScienceScripting.InitWorld(); timer = new System.Windows.Forms.Timer(); timer.Interval = 10; timer.Tick += timer_Tick; timer.Start(); Scripting = new UnrealScienceScripting(); Scripting.InitScripting(); Scripting.InitAnimationScripting(); if (UnrealScienceScripting.World.Entities.Count != 0) { Scripting.isPlaying = true; CreateScene(UnrealScienceScripting.World); isArray = true; } else if (Reader.Scene != null) { Scripting.isPlaying = true; CreateScene(Reader.Scene); } Resize(); InitSpeech(); }
public UartLogger(SerialPort serialPort, string fileName) { // Save the log file name strLogFileName = fileName; strRawLogFileName = "Raw_" + fileName; // Get the instance of serialPort this.serialPort = serialPort; // Instanciate the rx callback //serialPort.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(serialPort_DataReceived); backgroundWorker = new System.ComponentModel.BackgroundWorker(); backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker_DoWork); // Instanciate the rx timeout timer timerFrameTimeout = new System.Windows.Forms.Timer(); // Set an rx timeout value of 100ms timerFrameTimeout.Interval = 100; // Reset the frame counter iFrameCount = 0; // Reset the frame started flag bFrameStarted = false; // Instanciate the timer callback timerFrameTimeout.Tick += new System.EventHandler(this.timerFrameTimeout_Tick); // By default, the length of a frame is 5 bytes iFrameLength = 5; // By default, the frame reception timeout is 100ms iFrameRxTimeout = 100; // Instanciate a new list for reception buffer lReadBuffer = new List <byte>(); // create a file try { textWriter = File.CreateText(strLogFileName); textWriter.WriteLine("Date;Time;Counter;Event;Decoded Event;Param"); textWriter.Close(); textWriter.Dispose(); // Idem for rawTextWriter rawTextWriter = File.CreateText(strRawLogFileName); rawTextWriter.WriteLine("Date;Time;Data 0;Data 1;Data 2;Data 3;Data 4"); rawTextWriter.Close(); rawTextWriter.Dispose(); } catch (Exception ex) { Console.WriteLine(ex.Message); } StartRx(); }
/// <summary> /// 动画开始 /// </summary> /// <param name="_isadd">添加还是减少动画时间间隔(决定动画方向)</param> /// <param name="_usedTime">已进行动画时间</param> public void Start(bool _isadd, double _usedTime) { this.isadd = _isadd; this.Stop(); this.runTime = _usedTime; if (this.animationStart != null) { this.animationStart.Invoke(this._control, new AnimationEventArgs() { Data = this.options.Data, Transform = this.options.Transform, UsedTime = this.runTime, progressTime = getprogressTime(this.AT, this.options, this.runTime) }); } this.time = new System.Windows.Forms.Timer(); this.time.Tick += new EventHandler(this.time_Tick); this.time.Interval = this.interval; this.time.Start(); }
protected void Zhongting_fun(int maxcount, System.Windows.Forms.Timer tm) { //if (stopcount == 1) //{ // eform.toolStripStatusLabel3.Text = "中停 1 次"; //} //if (stopcount >= maxcount) //{ // tm.Stop(); // StateManager.SwitchState("StateEnd"); // che.SetWeizhi(che.X, che.Y); // che.SetRangle(che.Rangle); // eform.toolStripStatusLabel3.Text = "中停 2 次"; // eform.KaoShiEndFun(0, "中停"); //} }
/// <summary> /// Runs the timer cycle. /// </summary> /// <param name="state">The state.</param> private void RunTimerCycle(object state) { // Skip running this cycle if we are already in the middle of one if (IsCycleDone.IsInProgress) { return; } try { // Start a cycle by signaling it IsCycleDone.Begin(); // Call the configured timer callback TimerCallback(); } finally { if (HasRequestedStop == false) { // Finalize the cycle IsCycleDone.Complete(); } else { // Prevent a new cycle from being queued ThreadingTimer?.Change(Timeout.Infinite, Timeout.Infinite); FormsTimer?.Stop(); DispatcherTimer?.Stop(); // Handle the dispose process. ThreadingTimer?.Dispose(); FormsTimer?.Dispose(); // Remove references ThreadingTimer = null; FormsTimer = null; DispatcherTimer = null; // Complete the cycle and dispose of it IsCycleDone.Complete(); IsCycleDone.Dispose(); } } }
/// <summary> /// Требуемый метод для поддержки конструктора — не изменяйте /// содержимое этого метода с помощью редактора кода. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.Timer time; this.label1 = new System.Windows.Forms.Label(); time = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // time // time.Enabled = true; time.Interval = 1; time.Tick += new System.EventHandler(this.TimeTick); // // label1 // this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.BackColor = System.Drawing.SystemColors.InactiveBorder; this.label1.Enabled = false; this.label1.Font = new System.Drawing.Font("Mistral", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; this.label1.Location = new System.Drawing.Point(40, 65); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(269, 86); this.label1.TabIndex = 0; this.label1.Text = "00:00:00"; // // Clock // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.InactiveBorder; this.ClientSize = new System.Drawing.Size(341, 228); this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Name = "Clock"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Clock"; this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.btn_fft_time = new System.Windows.Forms.Button(); this.timer1 = new System.Windows.Forms.Timer(this.components); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // pictureBox1 // this.pictureBox1.Location = new System.Drawing.Point(12, 12); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(635, 560); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; // // btn_fft_time // this.btn_fft_time.Location = new System.Drawing.Point(653, 40); this.btn_fft_time.Name = "btn_fft_time"; this.btn_fft_time.Size = new System.Drawing.Size(75, 23); this.btn_fft_time.TabIndex = 1; this.btn_fft_time.Text = "FFT"; this.btn_fft_time.UseVisualStyleBackColor = true; this.btn_fft_time.Click += new System.EventHandler(this.Btn_fft_timeClick); // // timer1 // this.timer1.Interval = 10; this.timer1.Tick += new System.EventHandler(this.Timer1Tick); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(737, 593); this.Controls.Add(this.btn_fft_time); this.Controls.Add(this.pictureBox1); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1Load); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); }
private void Window_Loaded_1(object sender, RoutedEventArgs e) { m_hwnd = new WindowInteropHelper(this).Handle; Int32 windowStyle = GetWindowLongPtr(m_hwnd, GWL_STYLE); SetWindowLongPtr(m_hwnd, GWL_STYLE, windowStyle & ~WS_MAXIMIZEBOX); m_bIsSupportTaskbarManager = true; this.TaskbarItemInfo.ThumbnailClipMargin = new Thickness(0, 0, 0, 0); try { DateTime restoreStart = DateTime.Parse(TomatoTimerWPF.TimerSettings.Default.TimerRestoreDateTime); m_TimeDateStart = restoreStart; m_TimeDatePauseStart = restoreStart; m_mode = (TimerMode)TomatoTimerWPF.TimerSettings.Default.TimerRestoreMode; } catch (Exception) { m_TimeDateStart = DateTime.Now; m_TimeDatePauseStart = DateTime.Now; } m_pageButtons = new Page_Buttons(this); m_pageSettings = new Page_Settings(this); m_pageSoundSettings = new Page_SoundSettings(this); btnAlwaysOnTop.IsChecked = TomatoTimerWPF.TimerSettings.Default.AlwaysOnTop; if (btnAlwaysOnTop.IsChecked == true) { this.ToggleAlwaysOnTop(); } spWindowControlStackPanel.Margin = new Thickness(0, -this.Height, 0, 0); m_sbAniOut.Begin(spWindowControlStackPanel); this.ucContent.Children.Add(m_pageButtons); UpdateUI(); m_timer = new System.Windows.Forms.Timer(); m_timer.Interval = 1000; m_timer.Tick += new EventHandler(Timer_Tick); m_timer.Start(); }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.timer1 = new System.Windows.Forms.Timer(this.components); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // pictureBox1 // this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pictureBox1.BackColor = System.Drawing.Color.White; this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(543, 470); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBox1Paint); this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PictureBox1MouseDown); this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PictureBox1MouseMove); this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.PictureBox1MouseUp); this.pictureBox1.Resize += new System.EventHandler(this.PictureBox1Resize); // // timer1 // this.timer1.Interval = 1; this.timer1.Tick += new System.EventHandler(this.Timer1Tick); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(543, 470); this.Controls.Add(this.pictureBox1); this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Plátno"; ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); }
protected override void OnClosed(EventArgs e) { if (t != null) { t.Dispose(); t = null; } if (thread != null) { thread.Abort(); taskList.Clear(); taskList = null; resultList.Clear(); resultList = null; thread = null; } base.OnClosed(e); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { if (_redrawTimer != null) { _redrawTimer.Stop(); _redrawTimer.Dispose(); _redrawTimer = null; } // Must remember to dispose of the separator, as it can create a // message filter that would prevent it from being garbage collected _separatorController.Dispose(); } base.Dispose(disposing); }
/// <summary> /// 创建一个指定时间间隔的定时器 /// </summary> /// <param name="interval">定时器执行操作的间隔时间(毫秒)</param> /// <param name="start">是否启动</param> public TimerHelperForm(int interval, bool start) { timer = new System.Windows.Forms.Timer(); timerInterval = interval; timer.Interval = timerInterval; timer.Tick += new System.EventHandler(Tick); if (start) { timer.Enabled = true; timerState = TimerState.Running; } else { timer.Enabled = false; timerState = TimerState.Stopped; } }
/// <summary> /// Initialize a new instance of the LeftDownButtonController class. /// </summary> /// <param name="ribbon">Reference to owning ribbon instance.</param> /// <param name="target">Target for state changes.</param> /// <param name="needPaint">Delegate for notifying changes in display.</param> public LeftDownButtonController(KryptonRibbon ribbon, ViewBase target, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); Debug.Assert(target != null); Debug.Assert(needPaint != null); Ribbon = ribbon; Target = target; _needPaint = needPaint; _updateTimer = new System.Windows.Forms.Timer { Interval = 1 }; _updateTimer.Tick += OnUpdateTimer; }
public void Infect(int threatlevel) { Timer = new System.Windows.Forms.Timer(); Timer.Interval = 6000; Timer.Tick += (o, a) => { ulong codepointDecrease = (ulong)threatlevel * 4; if (SaveSystem.CurrentSave.Codepoints > codepointDecrease) { SaveSystem.CurrentSave.Codepoints -= codepointDecrease; } else { SaveSystem.CurrentSave.Codepoints = 0; } }; Timer.Start(); }
/** * @param target_pos target position for each point in Polygon * @param frame_count number of frame that construct the tweening */ public void tweening2(int[,] target_pos, int frame_count, Callback callback) { if (target_pos.GetLength(0) < this.vertices.GetLength(0) || frame_count < 2) { Console.WriteLine("[Debug] Tweening failed, new points length not match."); return; } TweenerStudio.Point[] start_pos = (TweenerStudio.Point[]) this.vertices.Clone(); System.Windows.Forms.Timer timr = new System.Windows.Forms.Timer(); timr.Tick += (sender, e) => { animate_vertices(sender, e, start_pos, target_pos, frame_count, callback); }; timr.Interval = 50; timr.Start(); }
/// <summary> /// Initialize a new instance of the GalleryButtonController class. /// </summary> /// <param name="target">Target for state changes.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> /// <param name="repeatTimer">Does the button repeat when pressed.</param> public GalleryButtonController(ViewBase target, NeedPaintHandler needPaint, bool repeatTimer) { Debug.Assert(target != null); Target = target; NeedPaint = needPaint; if (repeatTimer) { _repeatTimer = new System.Windows.Forms.Timer { Interval = 250 }; _repeatTimer.Tick += OnRepeatTick; } }
/// <summary> Setup for the page to get tweets</summary> private void Setup() { // Setup timer to get friends timeline _StatusTimer = new System.Windows.Forms.Timer(); _StatusTimer.Tick += StatusTimer_Tick; _StatusTimer.Interval = 1000 * 120; _StatusTimer.Start(); // Get friends timeline _bgwFriendsTimeLine.DoWork += bgwFriendsTimeLine_DoWork; _bgwFriendsTimeLine.RunWorkerCompleted += bgwFriendsTimeLine_Completed; bgwFriendsTimeLine_Start(); // Get my details _bgwMyStatus.DoWork += bgwMyStatus_DoWork; _bgwMyStatus.RunWorkerCompleted += bgwMyStatus_Completed; bgwMyStatus_Start(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { this.dgList.ItemsSource = this.transfers; this.overallProgressTimer = new System.Windows.Forms.Timer() { Interval = 100 }; this.overallProgressTimer.Tick += this.OverallProgressTimer_Tick; this.selectedComputer = this.Tag as Computer; this.txtCurrentComputerIP.Text = this.selectedComputer.IPAddress; if (this.fileTransferClient == null) { this.fileTransferClient = new TransferClient(); this.fileTransferClient.Connect(this.selectedComputer.IPAddress, 1818, this.ConnectCallback); this.IsEnabled = false; } }
//刷新设备信息 private void refreshTerminalInfos() { timer = new System.Windows.Forms.Timer(); timer.Tick += (s, e) => { timer.Stop(); try { QueryTerminalInfos(TreeViewModel.SelectedClassrooms); } finally { timer.Start(); } }; timer.Interval = 3000; timer.Start(); }
public Controller(IAnalysisView window) { this.window = window; ServerName = "http://cs3500-boggle-s17.azurewebsites.net/BoggleService.svc/"; Player2ID = "Player2"; Player1Score = 0; Player2Score = 0; FirstUpdate = true; timer = new System.Windows.Forms.Timer(); tokenSource = new CancellationTokenSource(); window.GameStart += StartMatch; window.Register += RegisterUser; window.CancelGame += QuitGame; window.WordEntered += NewWord; timer.Tick += WaitingForGame; window.RegCancel += CancelRegistration; window.JoinCancel += CancelJoinMatch; }
public static void parseSqlTime(String timeStamp, ref TimeSpan timer) { // Разбивает данные в виде полученного времени работы сотрудника на часы, минуты и секунды, и добавляет их к текущему таймеру try { String[] workSess = timeStamp.Split(':'); int sessWrHr = Convert.ToInt32(workSess[0].ElementAt(0) == '0' ? workSess[0].ElementAt(1).ToString() : workSess[0]); int sessWrMin = Convert.ToInt32(workSess[1].ElementAt(0) == '0' ? workSess[1].ElementAt(1).ToString() : workSess[1]); int sessWrSec = Convert.ToInt32(workSess[2].ElementAt(0) == '0' ? workSess[2].ElementAt(1).ToString() : workSess[2]); timer = timer.Add(TimeSpan.FromHours(sessWrHr)); timer = timer.Add(TimeSpan.FromMinutes(sessWrMin)); timer = timer.Add(TimeSpan.FromSeconds(sessWrSec)); } catch (Exception) { //Если вдруг данные получить не удалось, добавленное время будет 0 ч. 0 м. и 0 с. timer = timer.Add(TimeSpan.FromHours(0)); timer = timer.Add(TimeSpan.FromMinutes(0)); timer = timer.Add(TimeSpan.FromSeconds(0)); } }
/// <summary> /// Constructor /// </summary> /// <param name="headers"></param> /// <param name="rows"></param> public TruthTableWindow(List <string> headers, List <List <int> > rows, int inputs) { InitializeComponent(); // Set table properties this.Headers = headers; this.Rows = rows; this.numInputs = inputs; this.numOutputs = headers.Count - inputs; this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; // Create truth table and hover timer CreateTruthTable(); simulate = true; this.rowHoverTimer = new System.Windows.Forms.Timer(); this.rowHoverTimer.Interval = HOVER_INTERVAL; this.rowHoverTimer.Tick += new EventHandler(rowHoverTimer_Tick); }
/// <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.timer2 = new System.Windows.Forms.Timer(this.components); F2textBox1 = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // timer2 // this.timer2.Enabled = true; this.timer2.Interval = 500; this.timer2.Tick += new System.EventHandler(this.timer2_Tick); // // F2textBox1 // F2textBox1.BackColor = System.Drawing.SystemColors.Window; F2textBox1.Cursor = System.Windows.Forms.Cursors.Arrow; F2textBox1.Dock = System.Windows.Forms.DockStyle.Fill; F2textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F); F2textBox1.ImeMode = System.Windows.Forms.ImeMode.NoControl; F2textBox1.Location = new System.Drawing.Point(0, 0); F2textBox1.Multiline = true; F2textBox1.Name = "F2textBox1"; F2textBox1.ReadOnly = true; F2textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; F2textBox1.Size = new System.Drawing.Size(518, 602); F2textBox1.TabIndex = 2; F2textBox1.Text = "Join and Leave events"; // // Form2 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; this.AutoSize = true; this.ClientSize = new System.Drawing.Size(518, 602); this.Controls.Add(F2textBox1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); this.Name = "Form2"; this.Text = "Twitch Chat Bot - Join/Leave"; this.Load += new System.EventHandler(this.Form2_Load); this.ResumeLayout(false); this.PerformLayout(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { txtUserID._UCKeyPad = uCKeyPad; txtPassword._UCKeyPad = uCKeyPad; DateTime dt = new DateTime(2016, 06, 20); if (DateTime.Now.CompareTo(dt) >= 0) { System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 10000; timer.Tick += new EventHandler(timer_Tick); timer.Start(); } if (Utilities.SecurityKaraoke.CheckIsFirst(mTransit.ThamSo.BanQuyen)) { Data.Transit.MakeLisence(1, mTransit); string product = Utilities.SecurityKaraoke.GetProductID(0, mTransit.HashMD5); mTransit.ThamSo.BanQuyen = Utilities.SecurityKaraoke.GetKey(1, product, mTransit.HashMD5); mTransit.KaraokeEntities.SaveChanges(); } if (Utilities.SecurityKaraoke.CheckLisence(mTransit.ThamSo.BanQuyen, mTransit.HashMD5)) { string type = mTransit.ThamSo.BanQuyen.Substring(0, 1); if (type != "3") { DateTime now = DateTime.Now; now = new DateTime(now.Year, now.Month, now.Day); if ( !Utilities.SecurityKaraoke.CheckDate(mTransit.ThamSo.NgayBatDau.Value, mTransit.ThamSo.XacNhanNgayBatDau, mTransit.HashMD5) || !Utilities.SecurityKaraoke.CheckDate(mTransit.ThamSo.NgayKetThuc.Value, mTransit.ThamSo.XacNhanNgayKetThuc, mTransit.HashMD5) || now.CompareTo(mTransit.ThamSo.NgayBatDau.Value) < 0 || now.CompareTo(mTransit.ThamSo.NgayKetThuc.Value) > 0 ) { SecuriryLicense(); } } } else { SecuriryLicense(); } }
public PongGame(Spielermodus spielermodus, Punktemodus punktemodus) { // Modus werte speichern this.spielermodus = spielermodus; this.punktemodus = punktemodus; // Erzeuge neues spielfeld this.spielfeld = new Spielfeld(spielermodus); // Zeige das Spielfeld this.spielfeld.ShowGame(); // Hole graphics this.graphics = this.spielfeld.GetGraphics(); // Erzeuge ball und zeichne this.ball = new Ball(this.spielfeld.PictureBox.Size, 20); this.ball.Zeichnen(this.graphics); // Erzeuge spieler und zeichne this.spieler1 = new Spieler(SpielerPosition.Links, this.spielfeld.PictureBox.Size, "Spieler 1"); this.spieler1.Zeichnen(this.graphics); this.spieler2 = new Spieler(SpielerPosition.Rechts, this.spielfeld.PictureBox.Size, "Spieler 2"); this.spieler2.Zeichnen(this.graphics); // Übergebe dem Spielfeld die Spieler objekte damit es die Bewegung anpassen kann this.spielfeld.SetSpieler(spieler1, spieler2); // Übergebe dem Ball die Spieler damit er die kollision abfragen kann this.ball.SetSpieler(spieler1, spieler2); // Stelle die timer ein // GameTick Timer this.timerGameTick = new System.Windows.Forms.Timer() { Interval = 10 }; this.timerGameTick.Tick += this.timerGameTick_Tick; // Geschwindigkeit erhöhen timer this.timerIncreaseSpeed = new System.Windows.Forms.Timer() { Interval = 10000 }; this.timerIncreaseSpeed.Tick += this.TimerIncreaseSpeedTick_Tick; }
/// <summary> /// This method is required for Windows Forms designer support. /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.timer3 = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); // // timer1 // this.timer1.Interval = 6; this.timer1.Tick += new System.EventHandler(this.Timer1Tick); // // timer2 // this.timer2.Interval = 10; this.timer2.Tick += new System.EventHandler(this.Timer2Tick); // // timer3 // this.timer3.Interval = 24000; this.timer3.Tick += new System.EventHandler(this.Timer3Tick); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(212, 92); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "MainForm"; this.Opacity = 0.01D; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "gdifuncs"; this.TopMost = true; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.MainFormLoad); this.ResumeLayout(false); }
public void Shoot(ShootingPrinciple principle) { switch (principle) { case ShootingPrinciple.Automatic: System.Windows.Forms.Timer t = new System.Windows.Forms.Timer(); if (!hasShot && isAiming) { t.Tick += new EventHandler((object sender, EventArgs e) => { t.Stop(); M4A1Shooting.Play(); //AMMO SHOOT HERE var Ammo = new Ammunition.StandardAmmo(Handler, Device, Camera); Magazine.Add(Ammo); CurrentAmmo++; Magazine[CurrentAmmo].Shoot(Camera.ViewMatrix); hasShot = false; isAiming = false; }); hasShot = true; isAiming = true; t.Interval = 150; t.Start(); } break; case ShootingPrinciple.SemiAutomatic: if (!hasShot && isAiming) { hasShot = true; isAiming = true; M4A1Shooting.Play(); var Ammo = new Ammunition.StandardAmmo(Handler, Device, Camera); Magazine.Add(Ammo); CurrentAmmo++; Magazine[CurrentAmmo].Shoot(Camera.ViewMatrix); //AMMO SHOOT HERE } break; } }