public void Loaded() { KeyAssignCore.RegisterOperation("SookIkemen", () => KeyAssignHelper.ExecuteTabAction(tab => { try { tab.TabProperty.LinkAccountInfos.ForEach(a => PostOffice.UpdateTweet(a, "スークイケメンナーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー #sook_ikemen")); } catch (Exception e) { ExceptionStorage.Register(e, ExceptionCategory.PluginError, "スークイケメンナーーーーーーーーーーーーーーに失敗しました: " + e.Message); } })); KeyAssignCore.RegisterOperation("SenselessRetweet", () => KeyAssignHelper.ExecuteTVMAction(tvm => { var ts = tvm.Tweet.Status as TwitterStatus; if (ts == null) { return; } KernelService.MainWindowViewModel.InputBlockViewModel.SetOpenText(true, true); KernelService.MainWindowViewModel.InputBlockViewModel.SetText(BuildSenseless(ts)); })); KeyAssignCore.RegisterOperation("SenselessRetweetFast", () => KeyAssignHelper.ExecuteTVMAction(tvm => { try { var ts = tvm.Tweet.Status as TwitterStatus; if (ts == null) { return; } tvm.Parent.TabProperty.LinkAccountInfos.ForEach( ai => PostOffice.UpdateTweet(ai, BuildSenseless(ts))); } catch (Exception e) { ExceptionStorage.Register(e, ExceptionCategory.PluginError, "非常識RTに失敗しました: " + e.Message); } })); KernelService.AddMenu("スークイケメンナー", () => KeyAssignHelper.ExecuteTabAction(tab => { try { tab.TabProperty.LinkAccountInfos.ForEach(a => PostOffice.UpdateTweet(a, "スークイケメンナーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー #sook_ikemen")); } catch (Exception e) { ExceptionStorage.Register(e, ExceptionCategory.PluginError, "スークイケメンナーーーーーーーーーーーーーーに失敗しました: " + e.Message); } })); }
public void RegisterKeyAssign() { KeyAssignCore.RegisterOperation("OpenInput", () => this.OpenInput()); KeyAssignCore.RegisterOperation("CloseInput", () => { if (this.IntelliSenseTextBoxViewModel.IsItemOpening) { this.IntelliSenseTextBoxViewModel.IsItemOpening = false; } else { this.CloseInput(); this.Parent.ColumnOwnerViewModel.SetFocus(); } }); KeyAssignCore.RegisterOperation("ToggleAutoBind", () => this.IsEnabledAutoBind = !this.IsEnabledAutoBind); KeyAssignCore.RegisterOperation("RemoveInReplyTo", () => this.RemoveInReplyTo()); KeyAssignCore.RegisterOperation("AttachImage", () => this.AttachImage()); KeyAssignCore.RegisterOperation("Post", () => this.Update()); KeyAssignCore.RegisterOperation("PostAndClose", () => { if (!this.CanUpdate()) { return; } this.Update(); this.CloseInput(); this.Parent.ColumnOwnerViewModel.SetFocus(); }); KeyAssignCore.RegisterOperation("ShowConfig", () => this.ShowConfig()); KeyAssignCore.RegisterOperation("ShowAbout", () => this.ShowAbout()); KeyAssignCore.RegisterOperation("SelectNextAccount", () => SelectAccount(AccountSelection.Next)); KeyAssignCore.RegisterOperation("SelectPreviousAccount", () => SelectAccount(AccountSelection.Previous)); KeyAssignCore.RegisterOperation("SelectFirstAccount", () => SelectAccount(AccountSelection.First)); KeyAssignCore.RegisterOperation("SelectAllAccount", () => SelectAccount(AccountSelection.All)); }
public void RegisterKeyAssign() { // Moving focus KeyAssignCore.RegisterOperation("FocusToTimeline", this.SetFocus); KeyAssignCore.RegisterOperation("MoveLeft", () => MoveHorizontal(false, false)); KeyAssignCore.RegisterOperation("MoveLeftColumn", () => MoveHorizontal(false, true)); KeyAssignCore.RegisterOperation("MoveRight", () => MoveHorizontal(true, false)); KeyAssignCore.RegisterOperation("MoveRightColumn", () => MoveHorizontal(true, true)); KeyAssignCore.RegisterOperation("MoveDown", () => MoveVertical(ListSelectionKind.SelectBelow)); KeyAssignCore.RegisterOperation("MoveUp", () => MoveVertical(ListSelectionKind.SelectAbove)); KeyAssignCore.RegisterOperation("MoveTop", () => MoveVertical(ListSelectionKind.SelectFirst)); KeyAssignCore.RegisterOperation("MoveBottom", () => MoveVertical(ListSelectionKind.SelectLast)); KeyAssignCore.RegisterOperation("Deselect", () => MoveVertical(ListSelectionKind.Deselect)); // Moving focus (additional) KeyAssignCore.RegisterOperation("Select1stTab", () => SelectIndexOfTab(0)); KeyAssignCore.RegisterOperation("Select2ndTab", () => SelectIndexOfTab(1)); KeyAssignCore.RegisterOperation("Select3rdTab", () => SelectIndexOfTab(2)); KeyAssignCore.RegisterOperation("Select4thTab", () => SelectIndexOfTab(3)); KeyAssignCore.RegisterOperation("Select5thTab", () => SelectIndexOfTab(4)); KeyAssignCore.RegisterOperation("Select6thTab", () => SelectIndexOfTab(5)); KeyAssignCore.RegisterOperation("Select7thTab", () => SelectIndexOfTab(6)); KeyAssignCore.RegisterOperation("Select8thTab", () => SelectIndexOfTab(7)); KeyAssignCore.RegisterOperation("Select9thTab", () => SelectIndexOfTab(8)); KeyAssignCore.RegisterOperation("Select10thTab", () => SelectIndexOfTab(9)); KeyAssignCore.RegisterOperation("SelectNthTab", s => SelectIndexOfTab(Int32.Parse(s))); KeyAssignCore.RegisterOperation("Select1stColumn", () => SelectIndexOfColumn(0)); KeyAssignCore.RegisterOperation("Select2ndColumn", () => SelectIndexOfColumn(1)); KeyAssignCore.RegisterOperation("Select3rdColumn", () => SelectIndexOfColumn(2)); KeyAssignCore.RegisterOperation("Select4thColumn", () => SelectIndexOfColumn(3)); KeyAssignCore.RegisterOperation("Select5thColumn", () => SelectIndexOfColumn(4)); KeyAssignCore.RegisterOperation("Select6thColumn", () => SelectIndexOfColumn(5)); KeyAssignCore.RegisterOperation("Select7thColumn", () => SelectIndexOfColumn(6)); KeyAssignCore.RegisterOperation("Select8thColumn", () => SelectIndexOfColumn(7)); KeyAssignCore.RegisterOperation("Select9thColumn", () => SelectIndexOfColumn(8)); KeyAssignCore.RegisterOperation("Select10thColumn", () => SelectIndexOfColumn(9)); KeyAssignCore.RegisterOperation("SelectNthColumn", s => SelectIndexOfColumn(Int32.Parse(s))); KeyAssignCore.RegisterOperation("Select1stTweet", () => SelectIndexOfTimeline(0)); KeyAssignCore.RegisterOperation("Select2ndTweet", () => SelectIndexOfTimeline(1)); KeyAssignCore.RegisterOperation("Select3rdTweet", () => SelectIndexOfTimeline(2)); KeyAssignCore.RegisterOperation("Select4thTweet", () => SelectIndexOfTimeline(3)); KeyAssignCore.RegisterOperation("Select5thTweet", () => SelectIndexOfTimeline(4)); KeyAssignCore.RegisterOperation("Select6thTweet", () => SelectIndexOfTimeline(5)); KeyAssignCore.RegisterOperation("Select7thTweet", () => SelectIndexOfTimeline(6)); KeyAssignCore.RegisterOperation("Select8thTweet", () => SelectIndexOfTimeline(7)); KeyAssignCore.RegisterOperation("Select9thTweet", () => SelectIndexOfTimeline(8)); KeyAssignCore.RegisterOperation("Select10thTweet", () => SelectIndexOfTimeline(9)); KeyAssignCore.RegisterOperation("SelectNthTweet", s => SelectIndexOfTimeline(Int32.Parse(s))); KeyAssignCore.RegisterOperation("Open1stUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(0))); KeyAssignCore.RegisterOperation("Open2ndUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(1))); KeyAssignCore.RegisterOperation("Open3rdUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(2))); KeyAssignCore.RegisterOperation("Open4thUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(3))); KeyAssignCore.RegisterOperation("Open5thUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(4))); KeyAssignCore.RegisterOperation("Open6thUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(5))); KeyAssignCore.RegisterOperation("Open7thUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(6))); KeyAssignCore.RegisterOperation("Open8thUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(7))); KeyAssignCore.RegisterOperation("Open9thUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(8))); KeyAssignCore.RegisterOperation("Open10thUrl", () => ExecTVMAction(t => t.OpenIndexOfUrl(9))); KeyAssignCore.RegisterOperation("OpenNthUrl", s => ExecTVMAction(t => t.OpenIndexOfUrl(Int32.Parse(s)))); KeyAssignCore.RegisterOperation("Open1stAction", () => ExecTVMAction(t => t.OpenIndexOfAction(0))); KeyAssignCore.RegisterOperation("Open2ndAction", () => ExecTVMAction(t => t.OpenIndexOfAction(1))); KeyAssignCore.RegisterOperation("Open3rdAction", () => ExecTVMAction(t => t.OpenIndexOfAction(2))); KeyAssignCore.RegisterOperation("Open4thAction", () => ExecTVMAction(t => t.OpenIndexOfAction(3))); KeyAssignCore.RegisterOperation("Open5thAction", () => ExecTVMAction(t => t.OpenIndexOfAction(4))); KeyAssignCore.RegisterOperation("Open6thAction", () => ExecTVMAction(t => t.OpenIndexOfAction(5))); KeyAssignCore.RegisterOperation("Open7thAction", () => ExecTVMAction(t => t.OpenIndexOfAction(6))); KeyAssignCore.RegisterOperation("Open8thAction", () => ExecTVMAction(t => t.OpenIndexOfAction(7))); KeyAssignCore.RegisterOperation("Open9thAction", () => ExecTVMAction(t => t.OpenIndexOfAction(8))); KeyAssignCore.RegisterOperation("Open10thAction", () => ExecTVMAction(t => t.OpenIndexOfAction(9))); KeyAssignCore.RegisterOperation("OpenNthAction", s => ExecTVMAction(t => t.OpenIndexOfAction(Int32.Parse(s)))); // Timeline action KeyAssignCore.RegisterOperation("Mention", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.ReplyMouseActionCandidates.Reply, null))); KeyAssignCore.RegisterOperation("MentionSpecific", acc => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.ReplyMouseActionCandidates.ReplyFromSpecificAccount, acc))); KeyAssignCore.RegisterOperation("MentionImmediately", text => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.ReplyMouseActionCandidates.ReplyImmediately, text))); KeyAssignCore.RegisterOperation("MentionMulti", () => ExecTVMAction(vm => { MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.ReplyMouseActionCandidates.Reply, null); this.SetFocus(); })); KeyAssignCore.RegisterOperation("SendDirectMessage", () => ExecTVMAction(vm => vm.DirectMessageCommand.Execute())); KeyAssignCore.RegisterOperation("FavoriteThisTabAll", () => ExecTabAction(vm => vm.FavoriteThisTabAll())); KeyAssignCore.RegisterOperation("RetweetThisTabAll", () => ExecTabAction(vm => vm.RetweetThisTabAll())); KeyAssignCore.RegisterOperation("Favorite", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavToggle, null))); KeyAssignCore.RegisterOperation("FavoriteAdd", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavAdd, null))); KeyAssignCore.RegisterOperation("FavoriteRemove", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavRemove, null))); KeyAssignCore.RegisterOperation("FavoriteSelect", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavSelect, null))); KeyAssignCore.RegisterOperation("FavoriteAddAll", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavAddWithAllAccount, null))); KeyAssignCore.RegisterOperation("FavoriteRemoveAll", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavRemoveWithAllAccount, null))); KeyAssignCore.RegisterOperation("FavoriteSpecific", acc => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavToggleWithSpecificAccount, acc))); KeyAssignCore.RegisterOperation("FavoriteAddSpecific", acc => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavAddWithSpecificAccount, acc))); KeyAssignCore.RegisterOperation("FavoriteRemoveSpecific", acc => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.FavMouseActionCandidates.FavRemoveWithSpecificAccount, acc))); KeyAssignCore.RegisterOperation("FavoriteAndRetweet", () => ExecTVMAction(vm => vm.ToggleFavoriteAndRetweet())); KeyAssignCore.RegisterOperation("FavoriteAndSteal", () => ExecTVMAction(vm => vm.FavoriteAndSteal())); KeyAssignCore.RegisterOperation("Retweet", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetToggle, null))); KeyAssignCore.RegisterOperation("RetweetCreate", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetCreate, null))); KeyAssignCore.RegisterOperation("RetweetDelete", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetDelete, null))); KeyAssignCore.RegisterOperation("RetweetSelect", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetSelect, null))); KeyAssignCore.RegisterOperation("RetweetCreateAll", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetCreateWithAllAccount, null))); KeyAssignCore.RegisterOperation("RetweetDeleteAll", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetDeleteWithAllAccount, null))); KeyAssignCore.RegisterOperation("RetweetSpecific", acc => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetToggleWithSpecificAccount, acc))); KeyAssignCore.RegisterOperation("RetweetCreateSpecific", acc => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetCreateWithSpecificAccount, acc))); KeyAssignCore.RegisterOperation("RetweetDeleteSpecific", acc => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.RetweetMouseActionCandidates.RetweetDeleteWithSpecificAccount, acc))); KeyAssignCore.RegisterOperation("UnofficialRetweet", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.UnofficialRetweetQuoteMouseActionCandidates.DefaultUnofficialRetweet, null))); KeyAssignCore.RegisterOperation("QuoteTweet", () => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.UnofficialRetweetQuoteMouseActionCandidates.DefaultQuoteTweet, null))); KeyAssignCore.RegisterOperation("CustomUnofficialRetweet", arg => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.UnofficialRetweetQuoteMouseActionCandidates.CustomUnofficialRetweet, arg))); KeyAssignCore.RegisterOperation("CustomQuoteTweet", arg => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.UnofficialRetweetQuoteMouseActionCandidates.CustomQuoteTweet, arg))); KeyAssignCore.RegisterOperation("CustomUnofficialRetweetImmediately", arg => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.UnofficialRetweetQuoteMouseActionCandidates.CustomUnofficialRetweetImmediately, arg))); KeyAssignCore.RegisterOperation("CustomQuoteTweetImmediately", arg => ExecTVMAction(vm => MouseAssignCore.ExecuteAction(vm.Tweet, Configuration.Settings.UnofficialRetweetQuoteMouseActionCandidates.CustomQuoteTweetImmediately, arg))); KeyAssignCore.RegisterOperation("Steal", () => ExecTVMAction(vm => vm.Steal())); KeyAssignCore.RegisterOperation("Delete", () => ExecTVMAction(vm => vm.DeleteCommand.Execute())); KeyAssignCore.RegisterOperation("Mute", () => ExecTVMAction(vm => vm.MuteCommand.Execute())); KeyAssignCore.RegisterOperation("ReportForSpam", () => ExecTVMAction(vm => vm.ReportForSpamCommand.Execute())); KeyAssignCore.RegisterOperation("ShowConversation", () => ExecTVMAction(vm => vm.OpenConversationCommand.Execute())); KeyAssignCore.RegisterOperation("CreateSelectedUserTab", () => ExecTVMAction(vm => CreateUserTab(vm, false))); KeyAssignCore.RegisterOperation("CreateSelectedUserColumn", () => ExecTVMAction(vm => CreateUserTab(vm, true))); KeyAssignCore.RegisterOperation("OpenTweetWeb", () => ExecTVMAction(vm => vm.Tweet.ShowTweetCommand.Execute())); KeyAssignCore.RegisterOperation("ShowUserDetail", () => ExecTVMAction(vm => vm.ShowUserDetailCommand.Execute())); KeyAssignCore.RegisterOperation("CopySTOT", () => ExecTVMAction(vm => vm.Tweet.CopySTOTCommand.Execute())); KeyAssignCore.RegisterOperation("CopyWebUrl", () => ExecTVMAction(vm => vm.Tweet.CopyWebUrlCommand.Execute())); KeyAssignCore.RegisterOperation("CopyScreenName", () => ExecTVMAction(vm => vm.Tweet.CopyScreenNameCommand.Execute())); // Tab Action KeyAssignCore.RegisterOperation("Search", () => ExecTabAction(vm => { vm.AddTopTimeline(new[] { new FilterCluster() }); vm.Messenger.Raise(new InteractionMessage("FocusToSearch")); })); KeyAssignCore.RegisterOperation("RemoveViewStackTop", () => ExecTabAction(vm => vm.RemoveTopTimeline(false))); KeyAssignCore.RegisterOperation("RemoveViewStackAll", () => ExecTabAction(vm => vm.RemoveTopTimeline(true))); KeyAssignCore.RegisterOperation("OpenUserViewFromSearchBar", () => ExecTabAction(vm => vm.OpenUser())); KeyAssignCore.RegisterOperation("CreateTab", () => ExecTabAction(vm => vm.Parent.AddNewTabCommand.Execute())); KeyAssignCore.RegisterOperation("CloseTab", () => ExecTabAction(vm => vm.Parent.CloseTab(vm))); }