public PluginColumnViewModel(ExternalPlugin plugin) { this.plugin = plugin; SettingsCommand = new DelegateCommand( () => plugin.Instance.ShowSettingsDialog(), () => plugin.Instance.PluginInfo.HasSettingsDialog); DisablingCommand = new DelegateCommand( () => IsEnabled = !IsEnabled); }
private void Save(ConfigurationDao dao, ExternalPlugin plugin) { dao.PutPluginSettings( plugin.AssemblyName, plugin.Instance.PluginInfo.Name, new PluginSettings { IsEnabled = plugin.IsEnabled, Repository = plugin.Instance.Repository }); }
private PluginSettings Load(ConfigurationDao dao, ExternalPlugin plugin) { return dao.GetPluginSettings( plugin.AssemblyName, plugin.Instance.PluginInfo.Name); }
private void Terminate(ExternalPlugin plugin) { plugin.Instance.Terminate(); Save(dao, plugin); }
private void Initialize(ExternalPlugin plugin) { plugin.Instance.Repository = Load(dao, plugin).Repository ?? new Dictionary<string, object>(); plugin.Instance.Initialize(); }