本文整理汇总了C#中System.Windows.Forms.Timer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.Timer.Start方法的具体用法?C# System.Windows.Forms.Timer.Start怎么用?C# System.Windows.Forms.Timer.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Timer
的用法示例。
在下文中一共展示了System.Windows.Forms.Timer.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: 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;
}
示例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: CreateTimer
private Timer CreateTimer(Action action, int seconds)
{
var timer = new Timer();
timer.Tick += (sender, args) => action();
timer.Interval = seconds * 1000;
timer.Start();
return timer;
}
示例5: breakdown
public void breakdown()
{
setBrokenDown(true);
breakdownTimer = new System.Windows.Forms.Timer();
breakdownTimer.Interval = Settings.getSimSettings().getBreakdownTime();
breakdownTimer.Start();
breakdownTimer.Tick += new EventHandler(breakdown_Tick);
}
示例6: SparkleBubble
public SparkleBubble(string title, string subtext)
: base(title, subtext)
{
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer ();
timer.Tick += delegate { this.Close (); };
timer.Interval = 4500;
timer.Start ();
}
示例7: MovieScrapeFactory
/// <summary>
/// Initializes static members of the <see cref="MovieScrapeFactory"/> class.
/// </summary>
static MovieScrapeFactory()
{
postProcess = new BindingList<MovieModel>();
timer = new Timer();
timer.Tick += Timer_Tick;
timer.Interval = 100;
timer.Start();
}
示例8: ShowPage
public bool ShowPage(string url)
{
var window = dte.ItemOperations.Navigate(url, vsNavigateOptions.vsNavigateOptionsNewWindow);
activationTimer = new System.Windows.Forms.Timer();
activationTimer.Tick += (sender, args) => ActivateWindow(window);
activationTimer.Interval = 5000;
activationTimer.Start();
return true;
}
示例9: CreateTickTimer
private void CreateTickTimer()
{
DestroyTickTimer();
const float fps = 80;
float interval = (1.0f / fps) * 1000.0f;
tickTimer = new System.Windows.Forms.Timer();
tickTimer.Interval = (int)interval;
tickTimer.Tick += tickTimer_Tick;
tickTimer.Start();
}
示例10: Start
public void Start()
{
IsFlooding = true; LastAction = Tick();
tTimepoll = new System.Windows.Forms.Timer();
tTimepoll.Tick += new EventHandler(tTimepoll_Tick);
tTimepoll.Start();
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerAsync();
}
示例11: SampleCounter
/// <summary>
/// Constructor.
/// </summary>
public SampleCounter()
{
// Initialise variables
prevSamplesReceived = 0;
SamplesReceived = 0;
// Setup timer
timer = new System.Windows.Forms.Timer();
timer.Interval = 1000;
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
示例12: ProgressMeter
/// <summary>
/// Constructs a Time-Based progress meter that shows progress against an expected time.
/// </summary>
/// <param name="progressHandler"></param>
/// <param name="baseMessage"></param>
/// <param name="EstimatedTime"></param>
public ProgressMeter(IProgressHandler progressHandler, string baseMessage, TimeSpan EstimatedTime)
{
_progressHandler = progressHandler;
_baseMessage = baseMessage;
_timeSpan = EstimatedTime;
_endValue = EstimatedTime.TotalSeconds * 1000;
_timer = new System.Windows.Forms.Timer();
_timer.Interval = Convert.ToInt32(_timeSpan.TotalSeconds * 10); // Attempt to have a tick once during each estimated percentile
//_timer.Interval = 100;
_timer.Tick += new EventHandler(_timer_tick);
_timer.Start(); // Timers should be on another thread...
}
示例13: TimerBox
public TimerBox(TimeSpan time)
{
InitializeComponent();
this.Topmost = true;
this.Top = 0;
this.Left = 0;
timer = time;
timer1 =new System.Windows.Forms.Timer();
timer1.Interval = 1000;
timer1.Tick += new EventHandler(timer1_Tick);
initiate();
timer1.Start();
}
示例14: VirtualCapture
public VirtualCapture(string name, string uuid, Size size, int fps, int numRadialDistortionCoefficients = 0, Matrix<float> undistortMapX = null, Matrix<float> undistortMapY = null)
: base(name, uuid, size)
{
NumRadialDistortionCoefficients = numRadialDistortionCoefficients;
UndistortMapX = undistortMapX;
UndistortMapY = undistortMapY;
Rgba = new Picture<Rgba, byte>(Width, Height);
Gray = new Picture<Gray, byte>(Width, Height);
Timer = new Timer();
Timer.Interval = 1000 / fps;
Timer.Tick += Update;
Timer.Start();
}
示例15: GifImageStyle
public GifImageStyle(FastColoredTextBox parent)
: base(null, null, FontStyle.Regular)
{
ImagesByText = new Dictionary<string, Image>();
this.parent = parent;
//create timer
timer = new System.Windows.Forms.Timer();
timer.Interval = 100;
timer.Tick += (EventHandler)delegate
{
ImageAnimator.UpdateFrames();
parent.Invalidate();
};
timer.Start();
}