public object FindAndInvoke(string name, params object[] ps) { name = name.ToLowerInvariant(); SLModAction action = this.ModActions.ContainsKey(name) ? this.ModActions[name] : null; if (action != null) { return(action.Execute(ps)); } else { throw new NotSupportedException(string.Format("No such action: {0}", name)); } }
public void AddModAction(string name, SLModAction action) { name = name.ToLowerInvariant(); this.ModActions.Add(name, action); }