Added hooks for plugin options.
authorChip Black <bytex64@bytex64.net>
Sat, 6 Jun 2009 09:00:09 +0000 (04:00 -0500)
committerChip Black <bytex64@bytex64.net>
Sat, 6 Jun 2009 09:00:09 +0000 (04:00 -0500)
WebThingPlugin.cs

index 91c68ca..56caa4c 100644 (file)
@@ -1,8 +1,21 @@
+using System;
+using System.Collections.Generic;
 using WebKit;
 
 namespace bytex64.WebThing {
     public abstract class WebThingPlugin {
-        public abstract void Init(WebThing wt);
+        protected Dictionary<string,string> Options;
+
+        public WebThingPlugin() {
+            string classname = this.GetType().FullName;
+
+            if (Config.PluginOptions.ContainsKey(classname))
+                Options = Config.PluginOptions[classname];
+            else
+                Options = new Dictionary<string,string>();
+        }
+
+        public virtual void Init(WebThing wt) {}
         public virtual void InitWebView(WebView wv) {}
     }
 }