示例#1
0
 public DlgLadderReport(LadderGameSession[] gameSessions)
 {
     this.InitializeComponent();
     this.GameSessions = gameSessions;
 }
示例#2
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (this.GameSessions == null)
     {
         ErrorLog.WriteLine("Unable to determine players in game session", new object[0]);
         base.DialogResult = DialogResult.Abort;
         base.Close();
     }
     else
     {
         LadderGameSession session = null;
         LadderGameSession session2 = null;
         if (this.GameSessions.Length == 2)
         {
             if (this.GameSessions[0].EntityID == User.Current.ID)
             {
                 session = this.GameSessions[0];
                 session2 = this.GameSessions[1];
             }
             else
             {
                 session = this.GameSessions[1];
                 session2 = this.GameSessions[0];
             }
         }
         else if (this.GameSessions.Length == 1)
         {
             if (this.GameSessions[0].EntityID == User.Current.ID)
             {
                 session = this.GameSessions[0];
             }
             else
             {
                 session2 = this.GameSessions[0];
             }
         }
         else
         {
             ErrorLog.WriteLine("Unable to determine players in game session", new object[0]);
             base.DialogResult = DialogResult.Abort;
             base.Close();
             return;
         }
         this.InfoSession = session;
         if (this.InfoSession == null)
         {
             this.InfoSession = session2;
         }
         if (this.InfoSession == null)
         {
             ErrorLog.WriteLine("Unable to determine players in game session", new object[0]);
             base.DialogResult = DialogResult.Abort;
             base.Close();
         }
         else
         {
             this.gpgLabelDate.Text = DateTime.SpecifyKind(this.InfoSession.StartDate, DateTimeKind.Utc).ToLocalTime().ToString();
             this.gpgLabelLadderName.Text = this.InfoSession.LadderInstance.Description;
             if (session2 != null)
             {
                 this.gpgLabelOpponent.Text = session2.EntityName;
             }
             else
             {
                 this.gpgLabelOpponent.Text = Loc.Get("<LOC>Undetermined");
             }
             PictureBox[] boxArray = new PictureBox[] { this.pictureBoxRate1, this.pictureBoxRate2, this.pictureBoxRate3, this.pictureBoxRate4, this.pictureBoxRate5 };
             for (int i = 0; i < boxArray.Length; i++)
             {
                 boxArray[i].Image = VaultImages.star_empty;
             }
             this.PlayerSession = session;
             this.OpponentSession = session2;
             if ((this.PlayerSession != null) && (this.OpponentSession != null))
             {
                 base.MainForm.SetLastLadderGameType(this.InfoSession.LadderInstanceID, this.PlayerSession.IsAutomatch || (this.PlayerSession.StartRank < this.OpponentSession.StartRank));
             }
         }
     }
 }