private static void Load(string file) { if (!File.Exists(file)) { return; } try { var profile = KeyAssignProfile.FromFile(file); Profiles[profile.Name] = profile; } catch (Exception ex) { MainWindowModel.ShowTaskDialog( new TaskDialogOptions { Title = "キーアサイン エラー", MainIcon = VistaTaskDialogIcon.Error, MainInstruction = "キーアサインファイルを読み込めませんでした。", Content = "キーアサインファイルの記述に誤りがあります:" + Environment.NewLine + file, ExpandedInfo = ex.Message, CommonButtons = TaskDialogCommonButtons.Close }); } }
private static void Load(string file) { if (!File.Exists(file)) { return; } try { var profile = KeyAssignProfile.FromFile(file); Profiles[profile.Name] = profile; } catch (Exception ex) { MainWindowModel.ShowTaskDialog( new TaskDialogOptions { Title = SettingModelResources.KeyAssignErrorTitle, MainIcon = VistaTaskDialogIcon.Error, MainInstruction = SettingModelResources.KeyAssignErrorInst, Content = SettingModelResources.KeyAssignErrorContent + Environment.NewLine + file, ExpandedInfo = ex.Message, CommonButtons = TaskDialogCommonButtons.Close }); } }
public void AddNewKeyAssign() { var response = this.Messenger.GetResponse(new TransitionMessage(typeof(AddNewKeyAssignWindow), new AddNewKeyAssignDialogViewModel(), TransitionMode.Modal)); var tranvm = (AddNewKeyAssignDialogViewModel)response.TransitionViewModel; if (tranvm.Result) { var assign = new KeyAssignProfile(tranvm.FileName); if (tranvm.IsCreateAsCopy) { assign.SetAssigns( KeyAssignManager.CurrentProfile .ToString() .Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries)); } assign.Save(KeyAssignManager.KeyAssignsProfileDirectoryPath); RefreshKeyAssignCandidates(); } }
public void ClearCurrentProfile() { _profile = null; }
public static KeyAssignProfile GetEmpty() { var profile = new KeyAssignProfile("*EMPTY*"); return profile; }
public static KeyAssignProfile GetDefault() { var profile = new KeyAssignProfile(DefaultAssignName); const string assign = @"[Global] enter: FocusToInput c+t: FocusToTimeline c+q: FocusToSearch c+a+down: SelectNextAccount c+a+up: SelectPreviousAccount c+a+left: ClearSelectedAccounts c+a+right: SelectAllAccounts [Timeline] left: SelectLeftTab down: MoveDown up: MoveUp right: SelectRightTab h: SelectLeftTab j: MoveDown k: MoveUp l: SelectRightTab s+h: SelectLeftColumn s+j: MoveBottom s+k: MoveTop s+l: SelectRightColumn 0: MoveTop space: ToggleSelect f: Favorite # Semicolon Oem1: Favorite s+f: FavoriteMany r: Reply c+r: Retweet c+s+r: RetweetMany c+q: QuoteLink c+f: Favorite Retweet c+m: Reply(""@{0} もやし"") c+delete: Delete c+a+delete: Mute d: SendDirectMessage u: ShowUserProfile w: OpenWeb c+w: OpenFavstar s+1: OpenUrl(""0"") s+2: OpenUrl(""1"") s+3: OpenUrl(""2"") c+c: Copy c+s+c: CopySTOT c+a+c: CopyPermalink c+t: CreateTab c+F4: CloseTab c+s+t: RestoreTab escape: ClearSelect OemPeriod: ShowConversation [Input] escape: CloseInput #enter: Post c+enter: Post c+space: LoadStash c+o: AttachImage c+w: ToggleEscape c+b: ToggleBind up: Amend [Search] escape: CloseSearch FocusToTimeline c+t: SearchFromTab c+l: SearchFromLocal c+w: SearchFromWeb c+u: SearchUser c+s: SearchScreenName "; profile.SetAssigns(assign.Split(new[] { '\r', '\n' })); return profile; }
public static KeyAssignProfile GetEmpty() { var profile = new KeyAssignProfile("*EMPTY*"); return(profile); }
public static KeyAssignProfile GetDefault() { var profile = new KeyAssignProfile(DefaultAssignName); const string assign = @"[Global] enter: FocusToInput c+t: FocusToTimeline c+q: FocusToSearch c+a+down: SelectNextAccount c+a+up: SelectPreviousAccount c+a+left: ClearSelectedAccounts c+a+right: SelectAllAccounts [Timeline] left: SelectLeftTab down: MoveDown up: MoveUp right: SelectRightTab h: SelectLeftTab j: MoveDown k: MoveUp l: SelectRightTab s+h: SelectLeftColumn s+j: MoveBottom s+k: MoveTop s+l: SelectRightColumn 0: MoveTop space: ToggleSelect f: Favorite # Semicolon Oem1: Favorite s+f: FavoriteMany r: Reply c+r: Retweet c+s+r: RetweetMany c+q: QuoteLink c+f: Favorite Retweet c+m: Reply(""@{0} もやし"") c+delete: Delete c+a+delete: Mute d: SendDirectMessage u: ShowUserProfile w: OpenWeb c+w: OpenFavstar s+1: OpenUrl(""0"") s+2: OpenUrl(""1"") s+3: OpenUrl(""2"") c+c: Copy c+s+c: CopySTOT c+a+c: CopyPermalink c+t: CreateTab c+F4: CloseTab c+s+t: RestoreTab escape: ClearSelect OemPeriod: ShowConversation [Input] escape: CloseInput #enter: Post c+enter: Post c+space: LoadStash c+o: AttachImage c+w: ToggleEscape c+b: ToggleBind up: Amend [Search] escape: CloseSearch FocusToTimeline c+t: SearchFromTab c+l: SearchFromLocal c+w: SearchFromWeb c+u: SearchUser c+s: SearchScreenName "; profile.SetAssigns(assign.Split(new[] { '\r', '\n' })); return(profile); }