mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Update svn properties.
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
class ExtensionHandler : IExtension
|
||||
{
|
||||
private readonly Dictionary<Type, object> m_instances;
|
||||
|
||||
public ExtensionHandler(Dictionary<Type, object> instances)
|
||||
{
|
||||
m_instances = instances;
|
||||
}
|
||||
|
||||
public T Get<T>()
|
||||
{
|
||||
return (T) m_instances[typeof (T)];
|
||||
}
|
||||
|
||||
public bool TryGet<T>(out T extension)
|
||||
{
|
||||
if (!m_instances.ContainsKey(typeof(T)))
|
||||
{
|
||||
extension = default(T);
|
||||
return false;
|
||||
}
|
||||
|
||||
extension = Get<T>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Has<T>()
|
||||
{
|
||||
return m_instances.ContainsKey(typeof (T));
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
{
|
||||
class ExtensionHandler : IExtension
|
||||
{
|
||||
private readonly Dictionary<Type, object> m_instances;
|
||||
|
||||
public ExtensionHandler(Dictionary<Type, object> instances)
|
||||
{
|
||||
m_instances = instances;
|
||||
}
|
||||
|
||||
public T Get<T>()
|
||||
{
|
||||
return (T) m_instances[typeof (T)];
|
||||
}
|
||||
|
||||
public bool TryGet<T>(out T extension)
|
||||
{
|
||||
if (!m_instances.ContainsKey(typeof(T)))
|
||||
{
|
||||
extension = default(T);
|
||||
return false;
|
||||
}
|
||||
|
||||
extension = Get<T>();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Has<T>()
|
||||
{
|
||||
return m_instances.ContainsKey(typeof (T));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user