예제 #1
0
 private void SetRandomWallpaperBtn_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < 6; i++)
     {
         try
         {
             Uri randomPic = PictureController.GetRandomUriPic();
             WallpaperController.Set(randomPic, WallpaperController.Style.Stretched);
             return;
         }
         catch
         {
             MessageBox.Show(MessageHelper.GetMessageByName("RandomPicError"));
         }
     }
 }
예제 #2
0
        private void SetWallpaperBtn_Click(object sender, EventArgs e)
        {
            string pictureKey = this.PictureListCB.SelectedItem.ToString();

            if (String.IsNullOrEmpty(pictureKey))
            {
                MessageBox.Show(MessageHelper.GetMessageByName("EmptyPictureKey"));
                return;
            }

            try
            {
                Uri Pic = PictureController.GetUriPicByName(pictureKey);
                WallpaperController.Set(Pic, WallpaperController.Style.Stretched);
            }
            catch
            {
                MessageBox.Show(MessageHelper.GetMessageByName("SetPictureError"));
            }
        }