本文整理汇总了C#中System.Timers.Timer.BeginInit方法的典型用法代码示例。如果您正苦于以下问题:C# Timer.BeginInit方法的具体用法?C# Timer.BeginInit怎么用?C# Timer.BeginInit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Timers.Timer
的用法示例。
在下文中一共展示了Timer.BeginInit方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AlertBox
public AlertBox(Alert A)
{
InitializeComponent();
Invalidate();
try
{
using (MemoryStream memory = new MemoryStream())
{
A.GetIcon().Save(memory, ImageFormat.Png);
memory.Position = 0;
BitmapImage i = new BitmapImage();
i.BeginInit();
i.StreamSource = memory;
i.CacheOption = BitmapCacheOption.OnLoad;
i.EndInit();
A_ICON.Source = i;
}
using (MemoryStream memory = new MemoryStream())
{
global::Warmon.Properties.Resources.credits.Save(memory, ImageFormat.Png);
memory.Position = 0;
BitmapImage i = new BitmapImage();
i.BeginInit();
i.StreamSource = memory;
i.CacheOption = BitmapCacheOption.OnLoad;
i.EndInit();
A_CRED.Source = i;
}
turner = A;
A_CREDITS.Content = A.GetCredits();
A_REMAIN.Content = A.GetTimeOverdue();
A_TITLE.Content = A.GetTitle();
A_LOC.Content = A.GetMission() + " - " + A.GetPlanet();
System.Collections.IEnumerator en = A.GetRewards().GetEnumerator();
while (en.MoveNext())
{
A_REWARDS.Content += en.Current + "\n";
}
timmy = new Timer();
timmy.BeginInit();
timmy.Interval = 250;
timmy.Elapsed += delegate(object sender, ElapsedEventArgs e)
{
Dispatcher.BeginInvoke(DispatcherPriority.Background, new MainWindow.PrimeDelegate(UpdateTime));
};
timmy.EndInit();
timmy.Start();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
示例2: CommonTests
private void CommonTests (Timer t)
{
Assert.IsTrue (t.AutoReset, "AutoReset");
t.AutoReset = false;
Assert.IsFalse (t.Enabled, "Enabled");
t.Enabled = true;
Assert.IsNull (t.Site, "Site");
t.Site = null;
Assert.IsNull (t.SynchronizingObject, "SynchronizingObject");
t.SynchronizingObject = new TestSyncInvoke ();
t.Elapsed += new ElapsedEventHandler (Callback);
t.Elapsed -= new ElapsedEventHandler (Callback);
t.BeginInit ();
t.EndInit ();
t.Start ();
t.Stop ();
t.Close ();
(t as IDisposable).Dispose ();
}
示例3: PostInit
public void PostInit()
{
bw.RunWorkerAsync();
vicky = new Timer();
vicky.BeginInit();
vicky.Interval = 60000; //one minute
vicky.Elapsed += delegate(object s, ElapsedEventArgs e)
{
Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new PrimeDelegate(bw.RunWorkerAsync));
};
vicky.EndInit();
vicky.Start();
}
示例4: InitRxTools
private void InitRxTools()
{
_rxTimeout = new Timer();
_rxTimeout.BeginInit();
_rxTimeout.Elapsed += RxTimeoutElapsed;
_rxTimeout.Interval = Base.Options.InterpreterOptions.PacketSegmentReciveTimeOut.TotalMilliseconds;
_rxTimeout.AutoReset = false;
_rxTimeout.EndInit();
}