Created
June 3, 2021 17:28
-
-
Save Axemasta/7a8ba685870d32f2418da63ec2c17a95 to your computer and use it in GitHub Desktop.
Entry CreateButtonColor Effect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class EffectExtension | |
{ | |
public static TEffect GetFormsEffect<TEffect>(this Element element) | |
where TEffect : Effect | |
{ | |
if (element == null) | |
throw new ArgumentNullException("Forms element must not be null", nameof(element)); | |
var effect = element.Effects.FirstOrDefault(e => e is TEffect); | |
return (TEffect)effect; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment