mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-17 02:34:10 +02:00
Seal PluginConfig and add a method to disable official plugins from config
This commit is contained in:
parent
21354e675a
commit
b729dca2e5
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace TweetDck.Plugins{
|
namespace TweetDck.Plugins{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
class PluginConfig{
|
sealed class PluginConfig{
|
||||||
[field:NonSerialized]
|
[field:NonSerialized]
|
||||||
public event EventHandler<PluginChangedStateEventArgs> PluginChangedState;
|
public event EventHandler<PluginChangedStateEventArgs> PluginChangedState;
|
||||||
|
|
||||||
@ -33,5 +33,9 @@ public void SetEnabled(Plugin plugin, bool enabled){
|
|||||||
public bool IsEnabled(Plugin plugin){
|
public bool IsEnabled(Plugin plugin){
|
||||||
return !Disabled.Contains(plugin.Identifier) && plugin.CanRun;
|
return !Disabled.Contains(plugin.Identifier) && plugin.CanRun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DisableOfficialFromConfig(string pluginName){
|
||||||
|
Disabled.Add("official/"+pluginName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user