Esempio n. 1
0
 private void Preview_Load(object sender, EventArgs e)
 {
     if (Medias == null)
     {
         Medias = new List <Media>();
     }
     //update for translations
     NextPicButton.Text     = Translations.GetTranslatedString(NextPicButton.Name);
     PreviousPicButton.Text = Translations.GetTranslatedString(PreviousPicButton.Name);
     DevLinkLabel.Text      = Translations.GetTranslatedString(DevLinkLabel.Name);
     //check if devURL should be visable or not
     if (DBO.DevURL == null || DBO.DevURL.Equals(""))
     {
         DevLinkLabel.Enabled = false;
         DevLinkLabel.Visible = false;
     }
     //set default loading images and image properties
     LoadingImage = RelhaxModpack.Properties.Resources.loading;
     PreviewPicture.WaitOnLoad   = false;
     PreviewPicture.InitialImage = Settings.GetLoadingImage();
     Text = DBO.NameFormatted;
     for (int i = 0; i < Medias.Count; i++)
     {
         MakeLinkedLabel(i);
     }
     if (Medias != null)
     {
         CurrentlySelected = 0;
         if (Medias.Count > 0)
         {
             DisplayMedia(Medias[CurrentlySelected]);
         }
     }
     DescriptionBox.Text = (DBO.Description == null || DBO.Description.Equals(""))? Translations.GetTranslatedString("noDescription"): DBO.Description;
     DateFormat          = DBO.Timestamp == 0 ? "" : Utils.ConvertFiletimeTimestampToDate(DBO.Timestamp);
     UpdateBox.Text      = (DBO.UpdateComment == null || DBO.UpdateComment.Equals("")) ? Translations.GetTranslatedString("noUpdateInfo") : DBO.UpdateComment;
     UpdateBox.Text      = UpdateBox.Text + "\n" + LastUpdated + DateFormat;
     //specify the start location
     if (Utils.PointWithinScreen(Settings.PreviewX, Settings.PreviewY))
     {
         StartPosition = FormStartPosition.Manual;
         Location      = new Point(Settings.PreviewX, Settings.PreviewY);
     }
     if (Settings.SView == SelectionView.Legacy)
     {
         if (Program.Version == Program.ProgramVersion.Alpha)
         {
             Logging.Manager(string.Format("DEBUG: from Preview load: Legacy view, p.ContainsFocus={0}", this.ContainsFocus));
         }
         LegacyHotfixTimer.Start();
     }
 }
Esempio n. 2
0
 private void LegacyHotfixTimer_Tick(object sender, EventArgs e)
 {
     if (Settings.SView == SelectionView.Legacy)
     {
         if (Program.Version == Program.ProgramVersion.Alpha)
         {
             Logging.Manager(string.Format("DEBUG: from Preview timer: Legacy view, p.ContainsFocus={0}", this.ContainsFocus));
         }
         if (!this.ContainsFocus)
         {
             if (Program.Version == Program.ProgramVersion.Alpha)
             {
                 Logging.Manager(string.Format("DEBUG: from Preview timer: Legacy view, forcing focus conatin"));
             }
             this.Focus();
         }
     }
     LegacyHotfixTimer.Stop();
 }