Esempio n. 1
0
 private ActionHandler(string action, string name, ParamNode[] parms, Client.Plugin plugin)
 {
     this.m_Action = action;
     this.m_Name = name;
     this.m_Params = parms;
     this.m_Plugin = plugin;
 }
Esempio n. 2
0
 private ActionHandler(string action, string name, ParamNode[] parms, Client.Plugin plugin)
 {
     this.m_Action = action;
     this.m_Name   = name;
     this.m_Params = parms;
     this.m_Plugin = plugin;
 }
Esempio n. 3
0
        public static void Register(string action, ParamNode[] parms, Client.Plugin plugin)
        {
            string str;

            if (m_Table == null)
            {
                m_Table = new Hashtable();
            }
            if (m_List == null)
            {
                m_List = new ArrayList();
            }
            if (m_RootNode == null)
            {
                m_RootNode = new ActionNode("-root-");
            }
            string[]   strArray = action.Split(new char[] { '|' });
            ActionNode rootNode = m_RootNode;

            for (int i = 0; i < (strArray.Length - 1); i++)
            {
                ActionNode node = rootNode.GetNode(strArray[i]);
                if (node == null)
                {
                    rootNode.Nodes.Add(node = new ActionNode(strArray[i]));
                    rootNode.Nodes.Sort();
                }
                rootNode = node;
            }
            action = strArray[strArray.Length - 1];
            int index = action.IndexOf('@');

            if (index >= 0)
            {
                str    = action.Substring(index + 1);
                action = action.Substring(0, index);
            }
            else
            {
                str = action;
            }
            ActionHandler handler = new ActionHandler(action, str, parms, plugin);

            rootNode.Handlers.Add(handler);
            rootNode.Handlers.Sort();
            m_Table[action] = handler;
            m_List.Add(handler);
        }