Пример #1
0
        /// <summary>
        /// Logs the provider information.
        /// </summary>
        private static void LogProviderInfo(ILogger log, IPluginProviderProxy provider)
        {
            log.Info("  ^-- " + provider.Name + " " + provider.GetType().Assembly.GetName().Version);

            if (!string.IsNullOrEmpty(provider.Copyright))
            {
                log.Info("  ^-- " + provider.Copyright);
            }

            log.Info(string.Empty);
        }
Пример #2
0
        /// <summary>
        /// Validates the provider.
        /// </summary>
        private static void ValidateProvider(IPluginProviderProxy provider,
                                             Dictionary <string, IPluginProviderProxy> res)
        {
            if (provider == null)
            {
                throw new IgniteException(string.Format("{0}.CreateProvider can not return null",
                                                        typeof(IPluginConfiguration).Name));
            }

            if (string.IsNullOrEmpty(provider.Name))
            {
                throw new IgniteException(string.Format("{0}.Name should not be null or empty: {1}",
                                                        typeof(IPluginProvider <>), provider.Provider.GetType()));
            }

            if (res.ContainsKey(provider.Name))
            {
                throw new IgniteException(string.Format("Duplicate plugin name '{0}' is used by " +
                                                        "plugin providers '{1}' and '{2}'", provider.Name,
                                                        provider.Provider.GetType(), res[provider.Name].Provider.GetType()));
            }
        }