private void InitializeViewModelProperties(ShellProfile shellProfile) { SelectedTerminalTheme = TerminalThemes.FirstOrDefault(t => t.Id == shellProfile.TerminalThemeId); Id = shellProfile.Id; Name = shellProfile.Name; Arguments = shellProfile.Arguments; Location = shellProfile.Location; WorkingDirectory = shellProfile.WorkingDirectory; SelectedTabTheme = TabThemes.FirstOrDefault(t => t.Id == shellProfile.TabThemeId); PreInstalled = shellProfile.PreInstalled; KeyBindings.Clear(); foreach (var keyBinding in shellProfile.KeyBindings.Select(x => new KeyBinding(x)).ToList()) { KeyBindings.Add(keyBinding); } }
public void Restore(string data) { TerminalState state = JsonConvert.DeserializeObject <TerminalState>(data); if (state != null) { _hasCustomTitle = state.HasCustomTitle; ShellTitle = state.ShellTitle; TabTitle = state.TabTitle; TerminalTheme = state.TerminalTheme; TabTheme = TabThemes.FirstOrDefault(t => t.Theme.Id == state.TabThemeId); ShowSearchPanel = state.ShowSearchPanel; SearchText = state.SearchText; SearchMatchCase = state.SearchMatchCase; SearchWholeWord = state.SearchWholeWord; SearchWithRegex = state.SearchWithRegex; XtermBufferState = state.XtermBufferState; _terminalId = state.TerminalId; ShellProfile = state.ShellProfile; TabTheme.IsSelected = true; } }