Пример #1
0
        public wndMain()
        {
            try
            {
                //Config.Import();
                //UserData.ExportOldConfig();

                // read user settings
                // ConfigHandler.Save();

                UserData.ReadConfig();

                if (WorkdayHandler.getIsStarted())
                {
                    WorkdayHandler.WorkdayStart(UserData.getWorkDuration(), UserData.getWorkTimeStart());
                }

                ui_NotifyIcon Icon = new ui_NotifyIcon();
                Icon.trayIcon.Click += OnTrayClick;
                Icon.trayIcon.ContextMenu.MenuItems["settings"].Click += OnSettingsClick;
                Icon.trayIcon.ContextMenu.MenuItems["history"].Click  += OnHistoryClick;
                Icon.trayIcon.ContextMenu.MenuItems["exit"].Click     += OnExitClick;

                SessionHandler UserSession = new SessionHandler();
                UserSession.MyWorkdayEvent += new SessionHandler.EventDelegate(OnSessionStateChange);
                UserSession.VerifySessionState();
            }
            catch (Exception e) { MessageBox.Show(e.Source + "-----" + e.Message + "-------" + e.StackTrace + "-----------" + e.Data);
                                  Application.Current.Shutdown(1); }
        }
        private void buttonOK_Click(object sender, RoutedEventArgs e)
        {
            if (cbEndWorkday.IsChecked.Value)
            {
                WorkdayHandler.WorkdayEnd(pickerEndTime.Value.Value);
            }

            if (cbStartWorkday.IsChecked.Value)
            {
                WorkdayHandler.WorkdayStart(UserData.getWorkDuration(), pickerStartTime.Value.Value);
                UserData.setLastLockTime(DateTime.Now);
            }

            Close();
        }
Пример #3
0
 private void buttonSave_Click(object sender, RoutedEventArgs e)
 {
     WorkdayHandler.WorkdayStart(pickerWorkDuration.Value.Value, pickerStartTime.Value.Value);
     Close();
 }