public kOSExternalFunction(String name, object parent, String methodName, int parameterCount) { this.Name = name; this.Parent = parent; this.ParameterCount = parameterCount; this.MethodName = methodName; this.regex = Utils.BuildRegex(name + "_(" + parameterCount + ")"); }
static CommandRegistry() { foreach (Type t in Assembly.GetExecutingAssembly().GetTypes()) { CommandAttribute attr = (CommandAttribute)t.GetCustomAttributes(typeof(CommandAttribute), true).FirstOrDefault(); if (attr != null) { foreach (String s in attr.Values) { Bindings.Add(Utils.BuildRegex(s), t); } } } }