public static Config LoadConfigFromRegistry()
 {
     Config config = new Config();
     RegistryKey regkey = Registry.CurrentUser.CreateSubKey(REGISTRY_KEY);
     config.scriptEditorCommand           = (string)regkey.GetValue("ScriptEditorCommand", "");
     config.scriptEditorArgumentsFilename = (string)regkey.GetValue("ScriptEditorArgumentsFilename", "");
     config.scriptEditorArgumentsLine     = (string)regkey.GetValue("ScriptEditorArgumentsLine", "");
     regkey.Close();
     return config;
 }
Esempio n. 2
0
 private bool IsChanged(Config c)
 {
     if (c.scriptEditorCommand != ScriptEditorCommandTextBox.Text
         || c.scriptEditorArgumentsFilename != ScriptEditorArgumentsFilenameTextBox.Text
         || c.scriptEditorArgumentsLine != ScriptEditorArgumentsLineTextBox.Text)
     {
         return true;
     }
     return false;
 }
 public static bool SaveConfigToRegistry(Config config)
 {
     try
     {
         RegistryKey regkey = Registry.CurrentUser.CreateSubKey(REGISTRY_KEY);
         regkey.SetValue("ScriptEditorCommand",           config.scriptEditorCommand);
         regkey.SetValue("ScriptEditorArgumentsFilename", config.scriptEditorArgumentsFilename);
         regkey.SetValue("ScriptEditorArgumentsLine",     config.scriptEditorArgumentsLine);
         regkey.Close();
     }
     catch
     {
         return false;
     }
     return true;
 }
Esempio n. 4
0
 public Form1()
 {
     InitializeComponent();
     config = API.LoadConfigFromRegistry();
     PushConfig(config);
 }
Esempio n. 5
0
 private void PushConfig(Config c)
 {
     ScriptEditorCommandTextBox.Text           = c.scriptEditorCommand;
     ScriptEditorArgumentsFilenameTextBox.Text = c.scriptEditorArgumentsFilename;
     ScriptEditorArgumentsLineTextBox.Text     = c.scriptEditorArgumentsLine;
 }
Esempio n. 6
0
 private void PullConfig(Config c)
 {
     c.scriptEditorCommand           = ScriptEditorCommandTextBox.Text;
     c.scriptEditorArgumentsFilename = ScriptEditorArgumentsFilenameTextBox.Text;
     c.scriptEditorArgumentsLine     = ScriptEditorArgumentsLineTextBox.Text;
 }