private string GetCommandLineSwitchString() { var commandSwitchesString = new StringBuilder(); foreach (var option in GetCommandOptions()) { commandSwitchesString.AppendLine(string.Format("\t{0}{1} : {2}", ValidArgPrefixes.First(), option.CommandName, option.Description)); } return(commandSwitchesString.ToString()); }
private string GetCommandLineSwitchString() { var commandSwitchesString = new StringBuilder(); foreach (var item in SettingsFiles) { commandSwitchesString.AppendLine(string.Format("\t{0}{1} : Generates A New File Containing the {1} Details", ValidArgPrefixes.First(), item.SwitchName)); } return(commandSwitchesString.ToString()); }
public object ResolveObject(string rootFolder = null) { var qualifiedFileName = string.IsNullOrWhiteSpace(rootFolder) ? FileName : Path.Combine(rootFolder, FileName); if (!File.Exists(qualifiedFileName)) { throw new NullReferenceException("Could not find " + qualifiedFileName + ". To generate it run the command exe with the " + ValidArgPrefixes.First() + Type.Name + " switch"); } var smartSettingsJson = File.ReadAllText(qualifiedFileName); if (string.IsNullOrWhiteSpace(smartSettingsJson)) { throw new NullReferenceException(qualifiedFileName + " is empty. To generate it run the command exe with the " + ValidArgPrefixes.First() + Type.Name + " switch"); } return(JsonHelper.JsonStringToObject(smartSettingsJson, Type)); }