Esempio n. 1
0
        public override ActionTreeToken Perform()
        {
            Method m = null;

            // TODO: optimize this(set during initialization rather than runtime)
            foreach (ActionTreeToken child in _container.GetChildren())
            {
                if (child is Method)
                {
                    if (((Method)child).Name == _methodName)
                    {
                        m = (Method)child;
                        break;
                    }
                }
            }

            if (m == null)
            {
                // TODO: custom error
                throw new DataException("Method not found: " + _methodName);
            }

            return(m.Call(_arguments));
        }