/
diev
/
mRemoteNG
Обзор
Документация
Войти
/
diev
/
mRemoteNG
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
mRemoteNGTests/TestHelpers/FormExtensions.cs
20 строк
707 B
Ian Dunkerly
Fixing up unit tests
27 авг 2021, 23:20
27 авг 2021, 23:20
f77848e
Код
Авторство
О чём код?
using System.Linq; using System.Windows.Forms; namespace mRemoteNGTests.TestHelpers { public static class FormExtensions { /// <summary> /// Finds a control with the specified name on a form. /// </summary> /// <typeparam name="T">The type of control to find.</typeparam> /// <param name="form">The form.</param> /// <param name="name">The name of the control to find.</param> /// <returns>The control or null if not found or the wrong type.</returns> public static T FindControl<T>(this Form form, string name) where T : Control { return form.Controls.Find(name, true).SingleOrDefault() as T; } } }