aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs
diff options
context:
space:
mode:
authorJeff Ames2009-04-21 15:30:03 +0000
committerJeff Ames2009-04-21 15:30:03 +0000
commit13f5dd5f353c5ea5e86944af3dbaa739c8be1a8a (patch)
treedb2753c11ade99bfad52a28c96fc16520df865b1 /OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs
parent* Add the ability to update profiles via the cache, so that cached profiles d... (diff)
downloadopensim-SC-13f5dd5f353c5ea5e86944af3dbaa739c8be1a8a.zip
opensim-SC-13f5dd5f353c5ea5e86944af3dbaa739c8be1a8a.tar.gz
opensim-SC-13f5dd5f353c5ea5e86944af3dbaa739c8be1a8a.tar.bz2
opensim-SC-13f5dd5f353c5ea5e86944af3dbaa739c8be1a8a.tar.xz
Update svn properties.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs78
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 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces; 4using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces;
5 5
6namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 6namespace 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}