本文整理汇总了C#中System.Windows.Forms.Timer类的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.Timer类的具体用法?C# System.Windows.Forms.Timer怎么用?C# System.Windows.Forms.Timer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Windows.Forms.Timer类属于命名空间,在下文中一共展示了System.Windows.Forms.Timer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameMultiplayerControl
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;
}
示例2: TvNotifyManager
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();
}
示例3: Open
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;
}
}
示例4: InitializeComponent
/// <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);
}
示例5: 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.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();
}
示例6: ExplosionParticleEmitter
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;
}
}
示例7: InitializeComponent
/// <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);
}
示例8: 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.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);
}
示例9: SledSyntaxCheckerService
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();
}
示例10: 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.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);
}
示例11: DebrisParticleEmitter
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);
}
}
示例12: InitializeComponent
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);
}
示例13: InitializeComponent
/// <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);
}
示例14: 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.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);
}
示例15: SplashWindow_ContentRendered
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;
}