Beispiel #1
0
        public static SettingProvider GetProvider(Tiandao.Plugins.Plugin plugin)
        {
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }

            var configuration = OptionUtility.GetConfiguration(plugin);

            if (configuration == null)
            {
                return(null);
            }

            return(_cache.Get(plugin.FilePath, key =>
            {
                return new SettingProvider(plugin, configuration);
            }));
        }
Beispiel #2
0
        private void Loader_PluginLoaded(object sender, PluginLoadedEventArgs e)
        {
            var proxy = new ConfigurationProxy(() => OptionUtility.GetConfiguration(e.Plugin));

            e.Plugin.Context.ApplicationContext.OptionManager.Providers.Add(proxy);
        }