static AppSetting() { string configPath = Path.GetTempPath(); _fileName = Path.Combine(configPath, "ScutSM", "setting.ini"); _setting = new AppSetting(); LoadConfig(); }
public SettingForm(SettingTabType tabType, Action<string> errorOut) { _setting = AppSetting.Current; _errorOut = errorOut; InitializeComponent(); if (_setting.Entity.IsScript) { radioEntityPath.Checked = true; } else { radioEntityAsmPath.Checked = true; } LoadConfig(); this.tabControl1.SelectTab((int)tabType); }
private static void LoadConfig() { try { if (File.Exists(_fileName)) { string data = File.ReadAllText(_fileName, Encoding.UTF8); if (!string.IsNullOrEmpty(data)) { _setting = JsonUtils.Deserialize<AppSetting>(data); } LoadAssembly(); } } catch (Exception ex) { } }