Esempio n. 1
0
 private void Save(ConfigurationDao dao, ExternalPlugin plugin)
 {
     dao.PutPluginSettings(
         plugin.AssemblyName,
         plugin.Instance.PluginInfo.Name,
         new PluginSettings
         {
             IsEnabled = plugin.IsEnabled,
             Repository = plugin.Instance.Repository
         });
 }
        public PecaStarterModel(string title, IExternalResource externalResource)
        {
            Title = title;
            m_externalResource = externalResource;
            var tuple = GetYellowPagesLists();
            m_externalYellowPagesList = tuple.Item2;
            YellowPagesList = tuple.Item1;

            var dao = new ConfigurationDao(externalResource);
            pluginsModel = new PluginsModel(dao, externalResource.GetPlugins());
            Configuration = dao.Get();
            Configuration.DefaultLogPath = externalResource.DefaultLogPath;
            BroadcastModel = new BroadcastModel(Configuration, m_externalYellowPagesList, pluginsModel.Plugins);
        }
 public void Save()
 {
     var dao = new ConfigurationDao(m_externalResource);
     dao.Put(Configuration);
     pluginsModel.Save();
 }
Esempio n. 4
0
 private PluginSettings Load(ConfigurationDao dao, ExternalPlugin plugin)
 {
     return dao.GetPluginSettings(
         plugin.AssemblyName,
         plugin.Instance.PluginInfo.Name);
 }
Esempio n. 5
-1
 public PluginsModel(ConfigurationDao dao, PluginList plugins)
 {
     this.dao = dao;
     Plugins = plugins;
     foreach (var plugin in Plugins)
     {
         plugin.IsEnabledChanged += (s, e) =>
         {
             var p = (ExternalPlugin)s;
             if (p.IsEnabled)
                 Initialize(p);
             else
                 Terminate(p);
         };
     }
     InitializeAll();
 }