Ejemplo n.º 1
0
        private static INicknameResolver GetConfiguredNicknameResolverInstance(TMSPSCorePluginSettings settings, PluginHostContext context)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            INicknameResolver provider = Instancer.GetInstanceOfInterface <INicknameResolver>(settings.NicknameResolverAssemblyLocation, settings.NicknameResolverClass);

            provider.Init(context, settings.NicknameResolverConfigElement);

            return(provider);
        }
Ejemplo n.º 2
0
        public static void CreateSingleInstance(TMSPSCorePluginSettings settings, PluginHostContext context)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            if (Instance == null)
            {
                lock (_lockObject)
                {
                    if (Instance == null)
                    {
                        Instance = GetConfiguredNicknameResolverInstance(settings, context);
                    }
                }
            }
        }