コード例 #1
0
        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));
            }
        }
コード例 #2
0
 public void AddModAction(string name, SLModAction action)
 {
     name = name.ToLowerInvariant();
     this.ModActions.Add(name, action);
 }