diff options
Diffstat (limited to 'lib/utility/RegistryExtensions.cs')
| -rw-r--r-- | lib/utility/RegistryExtensions.cs | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/utility/RegistryExtensions.cs b/lib/utility/RegistryExtensions.cs index d995427..1ea20d0 100644 --- a/lib/utility/RegistryExtensions.cs +++ b/lib/utility/RegistryExtensions.cs @@ -1,29 +1,29 @@ -using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace gorilla.utility
-{
- public static class RegistryExtensions
- {
- public static K find_an_implementation_of<T, K>(this Registry<T> registry) where K : T
- {
- try
- {
- return registry
- .all()
- .Single(p => p.is_an_implementation_of<K>())
- .downcast_to<K>();
- }
- catch (Exception exception)
- {
- throw new Exception("Could Not Find an implementation of".format(typeof (K)), exception);
- }
- }
-
- public static IEnumerable<T> sort_all_using<T>(this Registry<T> registry, IComparer<T> comparer)
- {
- return registry.all().sorted_using(comparer);
- }
- }
-}
\ No newline at end of file +using System; +using System.Collections.Generic; +using System.Linq; + +namespace jive.utility +{ + public static class RegistryExtensions + { + public static K find_an_implementation_of<T, K>(this Registry<T> registry) where K : T + { + try + { + return registry + .all() + .Single(p => p.is_an_implementation_of<K>()) + .downcast_to<K>(); + } + catch (Exception exception) + { + throw new Exception("Could Not Find an implementation of".format(typeof (K)), exception); + } + } + + public static IEnumerable<T> sort_all_using<T>(this Registry<T> registry, IComparer<T> comparer) + { + return registry.all().sorted_using(comparer); + } + } +} |
