public AwardSetImage(Award award, AwardImageTypes type) : this() { WaitCallback callBack = null; if (callBack == null) { callBack = delegate (object s) { VGen0 method = null; Image awardImage; if (type == AwardImageTypes.Large) { awardImage = award.LargeImage; } else { awardImage = award.SmallImage; } if (!this.Disposing && !this.IsDisposed) { if (method == null) { method = delegate { this.Image = awardImage; }; } this.BeginInvoke(method); } }; } ThreadPool.QueueUserWorkItem(callBack); }
public PnlAwardDegree(GPG.Multiplayer.Statistics.Award award, int currentDegree) { this.InitializeComponent(); this.gpgLabelDescription.Text = award.AchievementDescription; if (award.AwardDegree <= currentDegree) { this.gpgLabelDescription.ForeColor = Color.FromArgb(220, 220, 220); } else if (award.AwardDegree == (currentDegree + 1)) { this.gpgLabelDescription.ForeColor = Color.FromArgb(0xcc, 0xcc, 0xff); this.gpgLabelDescription.Font = new Font(this.gpgLabelDescription.Font, FontStyle.Bold); } else { this.gpgLabelDescription.ForeColor = Color.Gray; } this.mAward = award; this.mCurrentDegree = currentDegree; }
public void DoLayout() { this.gpgPanelAwards.Controls.Clear(); ThreadPool.QueueUserWorkItem(delegate (object s) { try { Dictionary<AwardSet, Award> dictionary = new Dictionary<AwardSet, Award>(AwardSet.AllAwardSets.Count); foreach (AwardSet set in AwardSet.AllAwardSets.Values) { dictionary.Add(set, null); } foreach (PlayerAward award in PlayerAward.GetPlayerAwards(this.Player.Name)) { if ((award.IsAchieved && (this.Player.Award1 != award.AwardID)) && (((this.Player.Award2 != award.AwardID) && (this.Player.Award3 != award.AwardID)) && ((dictionary[award.Award.AwardSet] == null) || (dictionary[award.Award.AwardSet].AwardDegree < award.Award.AwardDegree)))) { dictionary[award.Award.AwardSet] = award.Award; } } int left = 0; int top = 0; using (Dictionary<AwardSet, Award>.Enumerator enumerator2 = dictionary.GetEnumerator()) { while (enumerator2.MoveNext()) { KeyValuePair<AwardSet, Award> award = enumerator2.Current; if (award.Value != null) { Image awardImage = award.Value.LargeImage; base.Invoke((VGen0)delegate { PictureBox box = new PictureBox { Cursor = Cursors.Hand, Size = new Size(0x30, 0x30), SizeMode = PictureBoxSizeMode.AutoSize, Image = awardImage, Left = left, Top = top, Tag = award }; this.gpgPanelAwards.Controls.Add(box); box.Click += delegate (object s1, EventArgs e1) { KeyValuePair<AwardSet, Award> tag = (KeyValuePair<AwardSet, Award>) (s1 as Control).Tag; this.mSelectedAward = tag.Value; this.DialogResult = DialogResult.OK; this.Close(); }; box.MouseEnter += delegate (object s1, EventArgs e1) { int awardDegree; PictureBox curbox = s1 as PictureBox; KeyValuePair<AwardSet, Award> tag = (KeyValuePair<AwardSet, Award>) (s1 as Control).Tag; if (tag.Value == null) { awardDegree = 0; } else { awardDegree = tag.Value.AwardDegree; } DlgAwardSetDetails.Singleton.BindToAward(tag.Key, awardDegree); Point point = this.gpgPanelAwards.PointToScreen(curbox.Location); point.Offset(0, -(DlgAwardSetDetails.Singleton.Height + 4)); DlgAwardSetDetails.Singleton.Location = point; DlgAwardSetDetails.Singleton.Show(); }; box.MouseLeave += delegate (object s1, EventArgs e1) { DlgAwardSetDetails.Singleton.Hide(); }; left += box.Width + 4; if ((left + box.Width) > this.gpgPanelAwards.Width) { left = 0; top += box.Height + 4; } }); } } } } catch (Exception exception) { ErrorLog.WriteLine(exception); } }); }
private void skinButtonClear_Click(object sender, EventArgs e) { this.mSelectedAward = null; base.DialogResult = DialogResult.OK; base.Close(); }