public void SetBingWallpaper(string location) { if (bingObject == null) { bingObject = new BingObject(); } bingImageFile = BingUtils.GetWallpaperFromBing(location, ref bingObject); Utils.SetWallpaper(bingImageFile); if (bingObject.config != null && bingObject.config.setLockScreen) { Utils.SetLockScreen(bingImageFile); } if (bingObject.images != null) { string info = bingObject.images.FirstOrDefault().copyright; if (info != null) { this.TextCopyright = Regex.Match(info, @"\(([^)]*)\)").Groups[1].Value; this.TextTitle = info.Replace(Regex.Match(info, @"\(([^)]*)\)").Groups[0].Value, ""); } } }
public MainWindow() { CloseSameProcesses(); InitializeComponent(); this.DataContext = this; bingObject = BingUtils.ReadConfig(); InitializeSettingsTab(); SetBingWallpaper(defaultLanguage); Minimize(); }