string CommandSet(string name, string input) { var path = IniAdapter.NameToPath(input); if (path == null) { return("ERROR Invalid Option path"); } var value = IniAdapter.GetValue(input); if (value == null) { return("ERROR Invalid Option value"); } var option = RuntimeProfile.Main.GetOption(path); if (option == null) { return("ERROR Option not found"); } option.Load(value); option.ApplyFromRoot(); return(option.Save()); }
protected void ExecutePrompt() { // Enter on empty prompt closes it if (input.Length == 0) { StopPrompt(); // Set a option value } else if (input.Contains("=")) { var path = IniAdapter.NameToPath(input); if (path != null) { var option = RuntimeProfile.Main.GetOption(path); var value = IniAdapter.GetValue(input); if (option != null && value != null) { option.Load(value); option.ApplyFromRoot(); input = ""; } } // Enter on an option shows it's value } else { var path = IniAdapter.NameToPath(input); if (path != null) { var option = RuntimeProfile.Main.GetOption(path); if (option != null) { input += " = " + option.Save(); } } } }