uTorrentNotifier.Config.Save C# (CSharp) Method

Save() public method

public Save ( ) : void
return void
        public void Save()
        {
            /* Save registry info only if we're changing the value */
            if (this._RunOnStartup != Properties.Settings.Default.RunOnStartup)
            {
                Microsoft.Win32.RegistryKey key =
                    Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

                if (this._RunOnStartup)
                    key.SetValue(Properties.Resources.Name, System.Windows.Forms.Application.ExecutablePath.ToString());
                else
                    key.DeleteValue(Properties.Resources.Name, false);

                Properties.Settings.Default.RunOnStartup = this._RunOnStartup;
            }
            Properties.Settings.Default.Save();
        }