Пример #1
0
 public ClickerViewModell() : base("Clicky")
 {
     if (File.Exists("paks2.json"))
     {
         var jsonString = File.ReadAllText("paks2.json");
         foreach (var clicky in JsonConvert.DeserializeObject <List <ClickyThingy> >(jsonString))
         {
             ClickPositions.Add(clicky);
         }
     }
     Messenger.Default.Register <TaskEnum>(this, enu => App.Current.Dispatcher.Invoke(() => HandleMessenger(enu)));
 }
Пример #2
0
 private void mh_MouseDownEvent(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         Stopwatch.Stop();
         ClickPositions.Add(new ClickyThingy()
         {
             Location = e.Location, Delay = (int)Stopwatch.ElapsedMilliseconds
         });
         Stopwatch.Reset();
         Stopwatch.Start();
     }
 }