public void LoadGOSetup(GOSetup loadedGOSetup) { if (loadedGOSetup == null) { Output.OutputToConsole("No GO Setup settings found"); return; } if (loadedGOSetup.goPath == null) { try { goPath = Environment.GetEnvironmentVariable("GOROOT", EnvironmentVariableTarget.Machine); } catch (Exception ex) { Output.OutputToConsole("Error! " + ex.Message); } } goPath = loadedGOSetup.goPath; githubUsername = loadedGOSetup.githubUsername; SettingsClass.Instance.setupSettings = this; }
public void LoadSettings() { if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\Settings\IDESettings.dat")) { FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + @"\Settings\IDESettings.dat", FileMode.Open, FileAccess.Read); BinaryFormatter bf = new BinaryFormatter(); SettingsClass loaded = (SettingsClass)bf.Deserialize(fs); setupSettings = loaded.setupSettings; setupSettings.LoadGOSetup(loaded.setupSettings); codeSettings = loaded.codeSettings; codeSettings.LoadEditorSettings(loaded.codeSettings); fs.Close(); } else { SaveSettings(); } }
public SettingsClass() { setupSettings = new GOSetup(); codeSettings = new CodeEditorSettings(); }