private void KeyAction(KeyEventArgs e) { switch (e.KeyCode) { case Keys.Escape: this.Close(); return; case Keys.OemPeriod: if (e.Control && webBrowser1.Focused) { if (DateTime.Now.Subtract(mLastLoadTime) <= TimeSpan.FromMilliseconds(REPEATING_MILS)) { return; } mLastLoadTime = DateTime.Now; if (mNavigator.Next() != null) { LoadMail(); } } break; case Keys.Oemcomma: if (e.Control && webBrowser1.Focused) { if (DateTime.Now.Subtract(mLastLoadTime) <= TimeSpan.FromMilliseconds(REPEATING_MILS)) { return; } mLastLoadTime = DateTime.Now; if (mNavigator.Previous() != null) { LoadMail(); } } break; default: return; } }
private void ExecuteAction(UserAction act) { try { switch (act) { case UserAction.Open: mNavigator.Current.Display(); break; case UserAction.Reply: ((dynamic)mNavigator.Current.InnerObject).Reply().Display(); break; case UserAction.ReplyAll: ((dynamic)mNavigator.Current.InnerObject).ReplyAll().Display(); break; case UserAction.Forward: ((dynamic)mNavigator.Current.InnerObject).Forward().Display(); break; case UserAction.DeleteCurrent: mNavigator.Delete(); RenderCurrentItem(); break; case UserAction.DeleteConversation: mNavigator.DeleteConversation(); RenderCurrentItem(); break; case UserAction.Next: if ((InConversationView && MIConversationJump.Checked ? mNavigator.NextConversationItem() : mNavigator.Next()) != null) { RenderCurrentItem(); } else { System.Media.SystemSounds.Beep.Play(); } break; case UserAction.Previous: if ((InConversationView && MIConversationJump.Checked ? mNavigator.PreviousConversationItem() : mNavigator.Previous()) != null) { RenderCurrentItem(); } else { System.Media.SystemSounds.Beep.Play(); } break; case UserAction.Reload: RenderCurrentItem(true); break; case UserAction.ConversationViewChanged: RenderCurrentItem(); break; case UserAction.Close: this.Close(); break; case UserAction.Readme: System.Diagnostics.Process.Start(Logger.AppRoot + @"\Readme.docx"); break; case UserAction.About: new About().ShowDialog(); break; case UserAction.Logs: System.Diagnostics.Process.Start(Util.AppLogger.LogDirectory); break; } } catch (System.Exception ex) { ExceptionHandler.Catch(ex); } }