예제 #1
0
 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;
 }
예제 #2
0
 private bool IsChanged(Config c)
 {
     if (c.scriptEditorCommand != ScriptEditorCommandTextBox.Text
         || c.scriptEditorArgumentsFilename != ScriptEditorArgumentsFilenameTextBox.Text
         || c.scriptEditorArgumentsLine != ScriptEditorArgumentsLineTextBox.Text)
     {
         return true;
     }
     return false;
 }
예제 #3
0
 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;
 }
예제 #4
0
 public Form1()
 {
     InitializeComponent();
     config = API.LoadConfigFromRegistry();
     PushConfig(config);
 }
예제 #5
0
 private void PushConfig(Config c)
 {
     ScriptEditorCommandTextBox.Text           = c.scriptEditorCommand;
     ScriptEditorArgumentsFilenameTextBox.Text = c.scriptEditorArgumentsFilename;
     ScriptEditorArgumentsLineTextBox.Text     = c.scriptEditorArgumentsLine;
 }
예제 #6
0
 private void PullConfig(Config c)
 {
     c.scriptEditorCommand           = ScriptEditorCommandTextBox.Text;
     c.scriptEditorArgumentsFilename = ScriptEditorArgumentsFilenameTextBox.Text;
     c.scriptEditorArgumentsLine     = ScriptEditorArgumentsLineTextBox.Text;
 }