예제 #1
0
        /// <summary>
        /// Checks tee fury to see if there is a new shirt design. If there is
        /// it will download the image, popup and display the current design.
        /// </summary>
        /// <returns>True if there was a new design, false otherwise<returns>
        private bool CheckForNewShirt()
        {
            var    settings        = Properties.Settings.Default;
            string lastImageURL    = settings.LastImageURL;
            string currentImageURL = TeeFuryQuerier.GetCurrentTShirtImageURL();

            if (String.IsNullOrEmpty(lastImageURL) || lastImageURL != currentImageURL)
            {
                //The shirt image has changed, update it.
                if (popupImage != null)
                {
                    popupImage.Dispose();
                }

                popupImage            = TeeFuryQuerier.GetShirtImageFromURL(currentImageURL);
                settings.LastImageURL = currentImageURL;
                settings.Save();

                ResizeToPreview();
                Show();
                return(true);
            }

            return(false);
        }
예제 #2
0
 /// <summary>
 /// When the app loads we need to check if there is a new shirt design
 /// </summary>
 private void Popup_Load(object sender, EventArgs e)
 {
     if (!CheckForNewShirt())
     {
         //The user has already seen this shirt design. But we still need to load the image.
         popupImage = TeeFuryQuerier.GetShirtImageFromURL(Properties.Settings.Default.LastImageURL);
     }
 }