示例#1
0
文件: Form1.cs 项目: pugwonk/wallpapr
        private void doSaveSettings()
        {
            //settings.ApiKey = txtApiKey.Text;
            settings.Frequency = Convert.ToInt32(numFrequency.Value);
            settings.Interval  = ddInterval.Text;
            settings.OrderBy   = ddOrderBy.Text;
            settings.Position  = ddPosition.Text;
            if (rbSearch.Checked)
            {
                settings.SearchOrFaves = 0;
            }
            else
            if (rbFaves.Checked)
            {
                settings.SearchOrFaves = 1;
            }
            else
            {
                settings.SearchOrFaves = 2;
            }
            settings.StartWithWindows = cbStartWithWindows.Checked;
            settings.CachePics        = cbCache.Checked;
            settings.ShowBubbles      = cbBubbles.Checked;
            // Also need to actually change the registry here
            RegistryKey myKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);

            if (settings.StartWithWindows)
            {
                myKey.SetValue("WallpaperFlickr",
                               System.Reflection.Assembly.GetExecutingAssembly().Location,
                               RegistryValueKind.String);
            }
            else
            {
                try
                {
                    myKey.DeleteValue("WallpaperFlickr");
                }
                catch
                {
                }
            }

            if (rbAllTags.Checked)
            {
                settings.TagMode = "all";
            }
            else
            {
                settings.TagMode = "any";
            }
            settings.Tags       = txtTags.Text;
            settings.UserId     = txtUserId.Text;
            settings.FaveUserId = txtFaveUserId.Text;
            settings.SaveSettings();
        }
示例#2
0
        internal void SaveSettings()
        {
            _settings.SaveSettings();

            RegistryKey myKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);

            if (StartWithWindows)
            {
                myKey.SetValue("WallpaperFlickr",
                               System.Reflection.Assembly.GetExecutingAssembly().Location,
                               RegistryValueKind.String);
            }
            else
            {
                try
                {
                    myKey.DeleteValue("WallpaperFlickr");
                }
                catch
                {
                }
            }
        }
示例#3
0
 internal void SaveSettings()
 {
     _settings.SaveSettings();
 }