internal void Setup() { DetectBaseUrl(); _processMsgClosed = false; _processMsg = new ProcessMessaging(); _processMsg.MessageReceived += new MessageReceivedEventHandler(MessageReceived); _processMsg.ReceieveMessages(); SetupThumbAndButtons(); EnableAppropriateButtons(); AddJumpList(); UpdateIcon(); if (_gmailClient.Emails.Count > 0) { _thumbForm.Invoke(new Action <int>(_thumbForm.UpdatePreviewThumb), 0); _thumbForm.Invoke(new Action <bool>(_thumbForm.ShowAppropriateThumb), false); } _timer = new System.Timers.Timer(); _timer.Interval = _checkInterval; _timerOn = true; _timer.Elapsed += TimerElapsed; }
static void Main(string[] args) { if (args.Length > 0) { ProcessMessaging.SendMessage(args[0]); Environment.Exit(0); return; } bool hasMutex; using (Mutex mutex = new Mutex(false, "KwertyGmailNotifier", out hasMutex)) { if (!hasMutex) { ProcessMessaging.SendMessage("inbox"); Environment.Exit(0); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } }
internal void Setup() { DetectBaseUrl(); _processMsgClosed = false; _processMsg = new ProcessMessaging(); _processMsg.MessageReceived +=new MessageReceivedEventHandler(MessageReceived); _processMsg.ReceieveMessages(); SetupThumbAndButtons(); EnableAppropriateButtons(); AddJumpList(); UpdateIcon(); if (_gmailClient.Emails.Count > 0) { _thumbForm.Invoke(new Action<int>(_thumbForm.UpdatePreviewThumb), 0); _thumbForm.Invoke(new Action<bool>(_thumbForm.ShowAppropriateThumb), false); } _timer = new System.Timers.Timer(); _timer.Interval = _checkInterval; _timerOn = true; _timer.Elapsed += TimerElapsed; }