浏览代码

Update BasePlugin.cs

Added ConfigurationChanged event.
BaronGreenback 4 年之前
父节点
当前提交
8c0748b677
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      MediaBrowser.Common/Plugins/BasePlugin.cs

+ 7 - 0
MediaBrowser.Common/Plugins/BasePlugin.cs

@@ -175,6 +175,11 @@ namespace MediaBrowser.Common.Plugins
         /// <value>The type of the configuration.</value>
         public Type ConfigurationType => typeof(TConfigurationType);
 
+        /// <summary>
+        /// Gets or sets the event handler that is triggered when this configuration changes.
+        /// </summary>
+        public EventHandler<BasePluginConfiguration> ConfigurationChanged { get; set; }
+
         /// <summary>
         /// Gets the name the assembly file.
         /// </summary>
@@ -270,6 +275,8 @@ namespace MediaBrowser.Common.Plugins
             Configuration = (TConfigurationType)configuration;
 
             SaveConfiguration();
+            
+            ConfigurationChanged.Invoke(this, configuration);
         }
 
         /// <inheritdoc />