diff options
Update svn properties.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs index bc159eb..d3efe9c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs | |||
@@ -1,39 +1,39 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces; | 4 | using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces; |
5 | 5 | ||
6 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 6 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
7 | { | 7 | { |
8 | class ExtensionHandler : IExtension | 8 | class ExtensionHandler : IExtension |
9 | { | 9 | { |
10 | private readonly Dictionary<Type, object> m_instances; | 10 | private readonly Dictionary<Type, object> m_instances; |
11 | 11 | ||
12 | public ExtensionHandler(Dictionary<Type, object> instances) | 12 | public ExtensionHandler(Dictionary<Type, object> instances) |
13 | { | 13 | { |
14 | m_instances = instances; | 14 | m_instances = instances; |
15 | } | 15 | } |
16 | 16 | ||
17 | public T Get<T>() | 17 | public T Get<T>() |
18 | { | 18 | { |
19 | return (T) m_instances[typeof (T)]; | 19 | return (T) m_instances[typeof (T)]; |
20 | } | 20 | } |
21 | 21 | ||
22 | public bool TryGet<T>(out T extension) | 22 | public bool TryGet<T>(out T extension) |
23 | { | 23 | { |
24 | if (!m_instances.ContainsKey(typeof(T))) | 24 | if (!m_instances.ContainsKey(typeof(T))) |
25 | { | 25 | { |
26 | extension = default(T); | 26 | extension = default(T); |
27 | return false; | 27 | return false; |
28 | } | 28 | } |
29 | 29 | ||
30 | extension = Get<T>(); | 30 | extension = Get<T>(); |
31 | return true; | 31 | return true; |
32 | } | 32 | } |
33 | 33 | ||
34 | public bool Has<T>() | 34 | public bool Has<T>() |
35 | { | 35 | { |
36 | return m_instances.ContainsKey(typeof (T)); | 36 | return m_instances.ContainsKey(typeof (T)); |
37 | } | 37 | } |
38 | } | 38 | } |
39 | } | 39 | } |