mirror of
https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF
synced 2024-11-10 13:44:13 +00:00
Converted ternary to try/catch
This commit is contained in:
parent
5971cf617a
commit
84a9080c59
1 changed files with 11 additions and 2 deletions
|
@ -116,8 +116,17 @@ namespace UWUVCI_AIO_WPF.Classes
|
|||
Pen shadow = new Pen(Color.FromArgb(190, 190, 190), 6.0F);
|
||||
StringFormat format = new StringFormat();
|
||||
|
||||
_imageVar = "_rectangle" + (new[] { "other", "NDS" }.Contains(console) ? "H4V3" : console);
|
||||
var rectangle = (Rectangle)GetType().GetField(_imageVar).GetValue(this);
|
||||
_imageVar = "_rectangle" + console;
|
||||
Rectangle rectangle;
|
||||
try
|
||||
{
|
||||
rectangle = (Rectangle)GetType().GetField(_imageVar).GetValue(this);
|
||||
}
|
||||
catch
|
||||
{
|
||||
//if rectangle isn't able to get set then H4V3 should be used.
|
||||
rectangle = _rectangleH4V3;
|
||||
}
|
||||
|
||||
if (TitleScreen != null)
|
||||
g.DrawImage(TitleScreen, rectangle);
|
||||
|
|
Loading…
Reference in a new issue