예제 #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); }
        }