private void OnApply() { try { string newRedirectPath = RedirectPathTextBox.Text; if (newRedirectPath == null) { newRedirectPath = ""; } newRedirectPath = newRedirectPath.Trim(); if (RedirectPath != null && !RedirectPath.Equals(newRedirectPath)) { RedirectPath = newRedirectPath; if (ConfigStorage != null) { ConfigStorage.SetValue(Config.ConfigRedirectRegistryEntryKey, newRedirectPath); } RegisterHelper.SetRedirectPath(newRedirectPath, false); if (ConfigStorage != null) { bool registryEntryEnabled = ConfigStorage.GetBool(Config.ConfigEnableRegistryEntryKey, Config.ConfigDefaultEnableRegistryEntryValue); if (registryEntryEnabled) { RegisterHelper.PutEntry(); } } } } catch (Exception e) { } }
public static void SetUpdateInterval(long updateInterval) { ConfigStorage storage = ConfigStorage.Global; if (storage == null) { return; } storage.SetValue(Config.ConfigIntervalKey, updateInterval.ToString()); }