mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-24 18:15:11 -05:00
Use generic pattern match
>7.0 c#
This commit is contained in:
@@ -101,8 +101,7 @@ private static IEnumerable<object> GetTranslatableControls(Control f)
|
||||
{
|
||||
foreach (Control child in control.Controls)
|
||||
{
|
||||
var childOfT = child as T;
|
||||
if (childOfT != null)
|
||||
if (child is T childOfT)
|
||||
yield return childOfT;
|
||||
|
||||
if (!child.HasChildren) continue;
|
||||
|
||||
@@ -28,8 +28,7 @@ internal static void CenterToForm(this Control child, Control parent)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
var t = aParent as T;
|
||||
if (t != null)
|
||||
if (aParent is T t)
|
||||
return t;
|
||||
|
||||
if (aParent.Parent != null)
|
||||
|
||||
Reference in New Issue
Block a user