diff options
| author | mo k <mo@mokhan.ca> | 2012-05-30 22:26:04 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-05-30 22:26:04 -0600 |
| commit | 18db302a64ad5ace63861a427ea66e0d29af14f3 (patch) | |
| tree | 39959e18f75fe029a20277b7549cff982136542b /src/core/extensions/Dynamic.cs | |
| parent | c156ffcd25324e4fd49345b7d76df012f8dc1dd9 (diff) | |
register subscribers of different events.main
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 |
