+
+ public bool Call(string funcname, params object[] args) {
+ bool found = false;
+ if (args.Length > 0) {
+ foreach (string key in PluginOrder) {
+ WebThingPlugin plugin = Plugins[key];
+ Type ptype = plugin.GetType();
+
+ List<Type> types = new List<Type>();
+ foreach (object o in args)
+ types.Add(o.GetType());
+
+ MethodInfo method = ptype.GetMethod(funcname, types.ToArray());
+ if (method == null) continue;
+ method.Invoke(plugin, args);
+ found = true;
+ }
+ } else {
+ foreach (string key in PluginOrder) {
+ WebThingPlugin plugin = Plugins[key];
+ Type ptype = plugin.GetType();
+
+ MethodInfo method = ptype.GetMethod(funcname, new Type[] {});
+ if (method == null) continue;
+ method.Invoke(plugin, null);
+ found = true;
+ }
+ }
+ return found;
+ }