using System; using System.Collections.Generic; using System.Text; namespace OpenSim.Framework { public class RegistryCore : IRegistryCore { protected Dictionary m_moduleInterfaces = new Dictionary(); /// /// Register an Module interface. /// /// /// public void RegisterInterface(T iface) { lock (m_moduleInterfaces) { if (!m_moduleInterfaces.ContainsKey(typeof(T))) { m_moduleInterfaces.Add(typeof(T), iface); } } } public bool TryGet(out T iface) { if (m_moduleInterfaces.ContainsKey(typeof(T))) { iface = (T)m_moduleInterfaces[typeof(T)]; return true; } iface = default(T); return false; } public T Get() { return (T)m_moduleInterfaces[typeof(T)]; } public void StackModuleInterface(M mod) { } public T[] RequestModuleInterfaces() { return new T[] { default(T) }; } } }