public Form1ViewModel() { // _ is a variable name, it's becoming a standard for something that is ignored RotateNowCommand = new MicroCommand( _ => true, _ => this.GetNewWallpaper() ); OKCommand = new MicroCommand( _ => true, _ => this.DoOk() ); _settings = new WallpaperFlickrSettings(); _settings.ReadSettings(); _timer.Tick += _timer_Tick; _timer.Start(); }
public Form1ViewModel() { _settings = new WallpaperFlickrSettings(); _settings.ReadSettings(); }
private void Form1_Load(object sender, EventArgs e) { settings = new WallpaperFlickrSettings(); settings.ReadSettings(); ddInterval.Items.Add("minutes"); ddInterval.Items.Add("hours"); ddInterval.Items.Add("days"); ddInterval.Items.Add("weeks"); ddInterval.Items.Add("months"); ddPosition.Items.Add("Centered"); ddPosition.Items.Add("Tiled"); ddPosition.Items.Add("Stretched"); ddPosition.Items.Add("Fill"); ddPosition.Items.Add("Fit"); //ddOrderBy.Items.Add("Date Posted Asc"); ddOrderBy.Items.Add("Newly Posted"); //ddOrderBy.Items.Add("Date Taken Asc"); ddOrderBy.Items.Add("Most Recently Taken"); //ddOrderBy.Items.Add("Least Interesting"); ddOrderBy.Items.Add("Most Interesting"); ddOrderBy.Items.Add("None"); ddOrderBy.Items.Add("Relevance"); lbVersion.Text = "Version " + Assembly.GetExecutingAssembly().GetName().Version.ToString(); numFrequency.Value = settings.Frequency; ddInterval.Text = settings.Interval; ddOrderBy.Text = settings.OrderBy; ddPosition.Text = settings.Position; //txtApiKey.Text = settings.ApiKey; txtTags.Text = settings.Tags; txtUserId.Text = settings.UserId; txtFaveUserId.Text = settings.FaveUserId; rbSearch.Checked = (settings.SearchOrFaves == 0); rbFaves.Checked = (settings.SearchOrFaves == 1); rbExplore.Checked = (settings.SearchOrFaves == 2); cbStartWithWindows.Checked = settings.StartWithWindows; cbCache.Checked = settings.CachePics; cbBubbles.Checked = settings.ShowBubbles; EnableSearchTypes(); rbAllTags.Checked = false; rbAnyTags.Checked = false; if (settings.TagMode == "all") { rbAllTags.Checked = true; } else { rbAnyTags.Checked = true; } timer1.Enabled = true; timer1.Interval = 60000; timer1.Start(); Hide(); if (settings.ApiKey.Equals(string.Empty)) { MessageBox.Show("Please read the readme.txt and follow the instructions to get an API key."); } GetNewWallpaper(); }