Example #1
0
 private void Main_Shown(object sender, EventArgs e)
 {
     if (Program.silentStart)
     {
         Hide();
         Notification welcome = new Notification(Mode.Message);
         welcome.Text = "Welcome back Sait. Have a nice day!";
         welcome.NotifyIcon = Resources.message_blue;
         welcome.Done += (o) => { this.Show(); this.Activate(); };
         welcome.Show();
         welcome.Activate();
         if (File.Exists(@"C:\Windows\Media\Windows Logon.wav"))
         {
             SoundPlayer welcomeSound = new SoundPlayer(@"C:\Windows\Media\Windows Logon.wav");
             welcomeSound.Play();
             welcomeSound.Dispose();
         }
         //PlaySound("Notification", UIntPtr.Zero, (uint)sndFlags.SND_SYNC);
     }
     materialFlatButton3.Focus();
     lastActive = materialFlatButton3;
     materialSingleLineTextField1.Enabled = true;
     materialLabel1.Font = SkinManager.ROBOTO_MEDIUM_12;
     timePickerPanel1.timePicker.ClockMenu.SnapWindow(this.Handle, this.Handle, new SnapPoint
     {
         OffsetConstantX = this.Location.X + 180,
         OffsetConstantY = materialListView1.Location.Y + 104
     });
     timePickerPanel1.timePicker.ClockMenu.ClockButtonOK.Click += TimePicker_Choosed;
     timePickerPanel1.timePicker.ClockMenu.Closed += delegate (object o, ToolStripDropDownClosedEventArgs evnt)
     {
         materialSingleLineTextField1.Enabled = true;
     };
     HandCursor = new Cursor(LoadCursor(IntPtr.Zero, idCursor.HAND));
     finishLoad = true;
 }
Example #2
0
 private void RemindWait_Tick(object sender, EventArgs e)
 {
     RemindWait.Stop();
     RemindWait.Enabled = false;
     Notification noti = new Notification();
     noti.Text = this.Message;
     noti.Dismiss += delegate (Notification nt)
     {
         this.reminderSettings.Dismiss = true;
         Settings.Default.Save();
     };
     noti.OnRemindNotify += delegate (object obj, NotificationEventArgs evnt)
     {
         RemindWait.Interval = (int)evnt.RemindAfter.TotalMilliseconds;
         RemindWait.Start();
         //MessageBox.Show("shit");
         //MessageBox.Show(this.reminderSettings.Message);
         reminderSettings.RemindAfter = evnt.RemindAfter;
         Settings.Default.Save();
         //MessageBox.Show(remindTime.ToString());
         //MessageBox.Show(remindTime.Add(evnt.RemindAfter).ToString());
         RemindTime = remindTime.Add(evnt.RemindAfter);
     };
     noti.Done += delegate (Notification nt)
     {
         RemindWait.Dispose();
         reminderSettings.FinishTime = DateTime.Now;
         reminderSettings.Completed = true;
         Settings.Default.Save();
         this.RemindFinish = true;
     };
     noti.Show();
 }