X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=WebThingPlugin.cs;h=6f23e9d54a6281da95b4142cb1da72276b8eca5d;hb=fc831a2ef0ae342cc73dee301e051bcfbbbeb82c;hp=6ad3e9db8f11bbcfc15e3087bb86ca1cb9616bd0;hpb=1b1f91b709e01680efda771cd905e460c08fb19a;p=WebThing.git diff --git a/WebThingPlugin.cs b/WebThingPlugin.cs index 6ad3e9d..6f23e9d 100644 --- a/WebThingPlugin.cs +++ b/WebThingPlugin.cs @@ -17,6 +17,14 @@ namespace bytex64.WebThing { } } + // Convenience function to easily save plugin configuration + protected void SaveConfig() { + if (Config.ConfigPathOut == null) return; + + string plugin_name = this.GetType().FullName; + Config.SaveFile(plugin_name, String.Format("{0}/{1}.conf", Config.ConfigPathOut, plugin_name)); + } + // Plugin life cycle public virtual void Init(WebThing wt) {} public virtual void Deinit(WebThing wt) {}