public MainState LoadState() { MainState state = null; if (File.Exists(_configPath)) { try { var json = File.ReadAllText(_configPath); state = JsonConvert.DeserializeObject <MainState>(json); } catch { state = null; } } if (state == null) { state = new MainState { SelectedBaseCommandType = BaseCommandTypes.FirstOrDefault(), SelectedLastObjectType = LastObjectTypes.FirstOrDefault(), SelectedResponseType = LastResponseTypes.FirstOrDefault(), CommandParameters = new Dictionary <string, string> { { "album", "The Fall of Math" }, { "artist", "65daysofstatic" } }, CommandMethodName = "album.getInfo", CommandPageNumber = "0", CommandItemCount = "20", }; } return(state); }
public MainState LoadState() { MainState state = null; if (File.Exists(_configPath)) { try { var json = File.ReadAllText(_configPath); state = JsonConvert.DeserializeObject<MainState>(json); } catch { state = null; } } if (state == null) { state = new MainState { SelectedBaseCommandType = BaseCommandTypes.FirstOrDefault(), SelectedLastObjectType = LastObjectTypes.FirstOrDefault(), SelectedResponseType = LastResponseTypes.FirstOrDefault(), CommandParameters = new Dictionary<string, string>{ {"album", "The Fall of Math"}, {"artist", "65daysofstatic"} }, CommandMethodName = "album.getInfo", CommandPageNumber = "0", CommandItemCount = "20", }; } return state; }