本文整理汇总了C#中System.Windows.Threading.DispatcherTimer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Threading.DispatcherTimer.Start方法的具体用法?C# System.Windows.Threading.DispatcherTimer.Start怎么用?C# System.Windows.Threading.DispatcherTimer.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Threading.DispatcherTimer
的用法示例。
在下文中一共展示了System.Windows.Threading.DispatcherTimer.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChooseReceiverWindow_Loaded
void ChooseReceiverWindow_Loaded(object sender, RoutedEventArgs e)
{
System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(0.5);
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
示例2: InitSysImg
//初始化系统界面
private void InitSysImg()
{
if (_flowElement != null)
{
//====================================================
//操作按钮组
InitOperBtnFrame();
#region 事件处理
this.txtNumShow.GotFocus += InputFocus;
this.txtNumShow.LostFocus += LostFocus;
#endregion
//====================================================
this.txtMachineCode.Text = GlobalCodeBuilder.MachineCodeBuilder;
//二维码
this.imgQrFram.Source = ButtonExtend.InitButtonWithNormalImg("imgQrFram");
this.imgQr.Source = ButtonExtend.InitButtonWithNormalImg("QRcode");
ShowTimer = new System.Windows.Threading.DispatcherTimer();
ShowTimer.Tick += new EventHandler(ShowCurTimer); //起个Timer一直获取当前时间
ShowTimer.Interval = new TimeSpan(0, 0, 0, 1, 0);
ShowTimer.Start();
//====================================================
ProcessInit();
}
}
示例3: Time_Start
public void Time_Start(object sender, RoutedEventArgs e)
{
timer = new System.Windows.Threading.DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 1);
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
示例4: AutoView
public AutoView(Session session)
{
InitializeComponent();
this.WindowState = WindowState.Maximized;
this.WindowStyle = WindowStyle.None;
this.ResizeMode = ResizeMode.NoResize;
this.session = session;
frameTimer = new System.Windows.Threading.DispatcherTimer();
frameTimer.Tick += OnFrame;
frameTimer.Interval = TimeSpan.FromSeconds(1.0 / 60.0);
frameTimer.Start();
frameTimer2 = new System.Windows.Threading.DispatcherTimer();
frameTimer2.Tick += OnFrame2;
frameTimer2.Interval = TimeSpan.FromSeconds(4.0);
frameTimer2.Start();
this.lastTick = Environment.TickCount;
rand = new Random(this.GetHashCode());
this.Show();
this.KeyDown += new System.Windows.Input.KeyEventHandler(AutoView_KeyDown);
CreateCircles();
CreateMessagePanels();
}
示例5: SetUpMissingDeviceTimer
private void SetUpMissingDeviceTimer()
{
System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(MissingDeviceTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
dispatcherTimer.Start();
}
示例6: StartTimer
public void StartTimer()
{
System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100); // 100 Milliseconds
myDispatcherTimer.Tick += new EventHandler(Each_Tick);
myDispatcherTimer.Start();
}
示例7: MainWindow
/*********************************************************************************************************
*
* СТАНДАРТНЫЕ ОБРАБОТЧИКИ
*
* *******************************************************************************************************/
public MainWindow()
{
InitializeComponent();
this.Title = SW_CAPTION;// + " " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();// +" " + SW_VERSION;
//!_windowsList.Add(Window.GetWindow(this));
initDevice();
initWindows();
initControlValues();
loadWindows();
initModules();
loadAppSettings();
//LogsClass.Instance.Files[LogsClass.MainIdx].LogText = "Программа " + SW_VERSION + " загрузилась";
dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(timerWork);
dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
dispatcherTimer.Start();
//
EGSE.Device.Start();
//
//DataContext = this.test;
hsiWin.DataContext = EGSE;
}
示例8: HandleLoaded
private void HandleLoaded(object sender, RoutedEventArgs e)
{
if (bridge == null)
{
WPFSpinnakerConfiguration.Init();
// Using log4net with Spinnaker is optional.
log4net.Config.XmlConfigurator.Configure();
SpinnakerLog4netAdapter.Init();
bridge = SpinnakerConfiguration.CurrentConfig.CreateBrowserBridge(webBrowser);
SplashViewModel splashViewModel = new SampleApplication.Core.SampleApplication().Init();
bridge.ShowView("SplashView.html", splashViewModel);
splashViewModel.PropertyChanged += (propSender,propChangeEvent) =>
{
if (propChangeEvent.PropertyName == "CurrentPage")
bridge.ExecuteScriptFunction("setHeroBackground");
};
System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler((o, tickArgs) =>
{
splashViewModel.RealtimeViewModel.HandleGUITimerTick();
});
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 50);
dispatcherTimer.Start();
}
}
示例9: KeepScreenAlive
public void KeepScreenAlive()
{
System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
timer.Tick += timer_Tick;
timer.Interval = TimeSpan.FromSeconds(60);
timer.Start();
}
示例10: StartTimer
private void StartTimer(object sender, System.Windows.RoutedEventArgs e)
{
System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
myDispatcherTimer.Interval = new TimeSpan(0, 0, 1);
myDispatcherTimer.Tick += new EventHandler(Each_Tick);
myDispatcherTimer.Start();
}
示例11: startTimer
private void startTimer()
{
System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0, 0, 3);
dispatcherTimer.Start();
}
示例12: calibrateButton_Click
//private void rightOverLeft_Checked(object sender, RoutedEventArgs e)
//{
// colorWindow.changeHandOrientation(0);
//}
//private void leftOverRight_Checked(object sender, RoutedEventArgs e)
//{
// colorWindow.changeHandOrientation(1);
//}
private void calibrateButton_Click(object sender, RoutedEventArgs e)
{
myDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
myDispatcherTimer.Interval = new TimeSpan(0, 0, 1); // 1 second
myDispatcherTimer.Tick += new EventHandler(Each_Tick);
myDispatcherTimer.Start();
}
示例13: Button_Click
private void Button_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = "*.*";
ofd.Filter = "Media Files (*.*)|*.*";
ofd.ShowDialog();
try
{
mediaElement.Source = new Uri(ofd.FileName);
textBlock.Text = mediaElement.Volume.ToString();
mediaElement.Pause();
}
catch
{
new NullReferenceException("Error");
}
System.Windows.Threading.DispatcherTimer dispatchTimer = new System.Windows.Threading.DispatcherTimer();
dispatchTimer.Tick += new EventHandler(timer_Tick);
dispatchTimer.Interval = new TimeSpan(0, 0, 1);
dispatchTimer.Start();
}
示例14: MainViewModel
public MainViewModel()
{
this.agencies = new ObservableCollection<Agency>();
this.routes = new ObservableCollection<Route>();
this.stops = new ObservableCollection<Stop>();
this.selectedRoutesNames = new ObservableCollection<string>();
this.currVehicles = new ObservableCollection<Vehicle>();
this.routeCache = new Dictionary<long, Route>();
this.stopCache = new Dictionary<long, Stop>();
this.arrivalCache = new Dictionary<long, Dictionary<long, ArrivalInfo>>();
this.segmentCache = new Dictionary<long,string>();
this.selectedRoutes = new List<long>();
this.selectedAgencies = new List<long>();
this.restoredAgencies = new List<long>();
this.restoredRoutes = new List<long>();
dt = new System.Windows.Threading.DispatcherTimer();
dt.Interval = new TimeSpan(0, 0, 0, 5);
dt.Tick += new EventHandler(dt_Tick);
dt.Start();
dataHandler = new TranslocDataHandler();
}
示例15: Accelerometro
public Accelerometro()
{
InitializeComponent();
accelerometer = new Accelerometer();
accelerometer.TimeBetweenUpdates = TimeSpan.FromMilliseconds(100);
accelerometer.Start();
myFile = IsolatedStorageFile.GetUserStoreForApplication();
if (!myFile.FileExists("Impo.txt"))
{
IsolatedStorageFileStream dataFile = myFile.CreateFile("Impo.txt");
dataFile.Close();
}
Wb = new WebBrowser();
Connesso = false;
Carica();
System.Windows.Threading.DispatcherTimer dt = new System.Windows.Threading.DispatcherTimer();
dt.Interval = new TimeSpan(0, 0, 0, 0, 250); // 500 Milliseconds
dt.Tick += new EventHandler(dt_Tick);
dt.Start();
}