diff options
Diffstat (limited to 'src/core/extensions/Dynamic.cs')
| -rwxr-xr-x | src/core/extensions/Dynamic.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/extensions/Dynamic.cs b/src/core/extensions/Dynamic.cs index b08f7b1..df34945 100755 --- a/src/core/extensions/Dynamic.cs +++ b/src/core/extensions/Dynamic.cs @@ -6,7 +6,13 @@ namespace core.extensions {
public static void call_as<DynamicType>(this object target, Action<DynamicType> command) where DynamicType : class
{
- command(target.DowncastTo<DynamicType>());
+ target.downcast_to<DynamicType>().run(command);
+ }
+
+ public static void run<T>(this T target, Action<T> command)
+ {
+ if (null == target) return;
+ command(target);
}
}
}
\ No newline at end of file |
