internal static Control <TOwner> GetControlByDelegate <TOwner>(Delegate controlDelegate) where TOwner : PageObject <TOwner> { controlDelegate.CheckNotNull(nameof(controlDelegate)); if (DelegateControls.TryGetValue(controlDelegate, out UIComponent control)) { return((Control <TOwner>)control); } else { throw new ArgumentException($"Failed to find mapped control by specified '{nameof(controlDelegate)}'.", nameof(controlDelegate)); } }