#region COPYRIGHT
//
//     THIS IS GENERATED BY TEMPLATE
//     
//     AUTHOR  :     ROYE
//     DATE       :     2010
//
//     COPYRIGHT (C) 2010, TIANXIAHOTEL TECHNOLOGIES CO., LTD. ALL RIGHTS RESERVED.
//
#endregion

using System;
using System.Collections.Generic;
using System.Reflection;

namespace System.Text.Template
{
    internal class StaticMethod : MethodDefinition
    {
        public StaticMethod(MethodInfo methodInfo)
            : base(methodInfo)
        {
        }

        public StaticMethod(Type type, string methodName)
            : base(type, methodName)
        {
        }

        public override object Invoke(Type[] types, object[] parameters, out Type returnType)
        {
            MethodInfo methodInfo = GetMethodInfo(types);

            returnType = methodInfo.ReturnType;

            return methodInfo.Invoke(null, parameters);
        }
    }
}
