private PreDefinedCommand loadDefaultCommands() { PreDefinedCommand result = null; string fileName = "DefaultCommands.json"; var streamInfo = readAppFile(fileName); if (streamInfo == null) { streamInfo = readAppResource(fileName); } if (streamInfo != null) { StreamReader sr = new StreamReader(streamInfo.Stream); try { result = PreDefinedCommand.loadJson(sr.ReadToEnd()); } catch (JsonException e) { Debug.WriteLine(e); } if (result == null) { result = new PreDefinedCommand(); result.Version = 0; result.QuickCommands = new System.Collections.Generic.List <QuickCommand>(); } } return(result); }
public PreDefinedCommand GetPreDefinedCommand() { if (preDefinedCommand == null) { preDefinedCommand = loadDefaultCommands(); } return(preDefinedCommand); }