private void ViewGiftData(DataMysteryGift g) { try { // only check if the form is visible (not opening) if (Visible && g.GiftUsed && DialogResult.Yes == WinFormsUtil.Prompt(MessageBoxButtons.YesNo, MsgMsyteryGiftUsedAlert, MsgMysteryGiftUsedFix)) { g.GiftUsed = false; } RTB.Lines = g.GetDescription().ToArray(); PB_Preview.Image = g.Sprite(); mg = g; } catch (Exception e) { WinFormsUtil.Error(MsgMysteryGiftParseTypeUnknown, e); RTB.Clear(); } }
private void ViewGiftData(DataMysteryGift g) { try { // only check if the form is visible (not opening) if (Visible && g.GiftUsed && DialogResult.Yes == WinFormsUtil.Prompt(MessageBoxButtons.YesNo, MsgMsyteryGiftUsedAlert, MsgMysteryGiftUsedFix)) { g.GiftUsed = false; } RTB.Lines = g.GetDescription().ToArray(); PB_Preview.Image = g.Sprite(); mg = g; } // Some user input mystery gifts can have out-of-bounds values. Just swallow any exception. #pragma warning disable CA1031 // Do not catch general exception types catch (Exception e) #pragma warning restore CA1031 // Do not catch general exception types { WinFormsUtil.Error(MsgMysteryGiftParseTypeUnknown, e); RTB.Clear(); } }