public PluginColumnViewModel(ExternalPlugin plugin)
 {
     this.plugin = plugin;
     SettingsCommand = new DelegateCommand(
         () => plugin.Instance.ShowSettingsDialog(),
         () => plugin.Instance.PluginInfo.HasSettingsDialog);
     DisablingCommand = new DelegateCommand(
         () => IsEnabled = !IsEnabled);
 }
예제 #2
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
         });
 }
예제 #3
0
 private PluginSettings Load(ConfigurationDao dao, ExternalPlugin plugin)
 {
     return dao.GetPluginSettings(
         plugin.AssemblyName,
         plugin.Instance.PluginInfo.Name);
 }
예제 #4
0
 private void Terminate(ExternalPlugin plugin)
 {
     plugin.Instance.Terminate();
     Save(dao, plugin);
 }
예제 #5
0
 private void Initialize(ExternalPlugin plugin)
 {
     plugin.Instance.Repository = Load(dao, plugin).Repository
         ?? new Dictionary<string, object>();
     plugin.Instance.Initialize();
 }