private void MenuButton_Click(object sender, RoutedEventArgs e)
 {
     MySchedule.removeAllSchedule();
     MyTask.clearAllTasks();
     TreeSession.clearAllTrees();
     Task.Factory.StartNew(() => Thread.Sleep(1000)).ContinueWith(t =>
     {
         MainWindowViewModel.MainSnackbarMessageQueue?.Enqueue("清除缓存成功");
     }, TaskScheduler.FromCurrentSynchronizationContext());
 }
Exemplo n.º 2
0
 public VirtualTreePlantingViewModel()
 {
     JobManager.AddJob(
         () => UpdateProcess(),
         s => s.ToRunNow().AndEvery(30).Seconds().DelayFor(1).Seconds()
         );
     JobManager.AddJob(
         () => InitializeListBox(),
         s => s.ToRunOnceIn(2).Seconds()
         );
     TreeSession.loadAllTreeSession();
 }