mirror of
https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF
synced 2025-02-17 11:08:23 +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);
|
Pen shadow = new Pen(Color.FromArgb(190, 190, 190), 6.0F);
|
||||||
StringFormat format = new StringFormat();
|
StringFormat format = new StringFormat();
|
||||||
|
|
||||||
_imageVar = "_rectangle" + (new[] { "other", "NDS" }.Contains(console) ? "H4V3" : console);
|
_imageVar = "_rectangle" + console;
|
||||||
var rectangle = (Rectangle)GetType().GetField(_imageVar).GetValue(this);
|
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)
|
if (TitleScreen != null)
|
||||||
g.DrawImage(TitleScreen, rectangle);
|
g.DrawImage(TitleScreen, rectangle);
|
||||||
|
|
Loading…
Add table
Reference in a new issue