示例#1
0
        //private static bool GEtMethodsFromClass(ClassDef methodClass, string strMethodName, out Method TagetMethod)
        //{
        //    TagetMethod = null;
        //    Method tmpTagetMethod = methodClass.GetMethodDesc(strMethodName);

        //    if (tmpTagetMethod != null)
        //    {
        //        TagetMethod = tmpTagetMethod;
        //        return true;
        //    }


        //    return false;
        //}
        private static bool GetLoggerMethodsFromClass(ClassRef methodLogger, out Method startLogMethod, out Method endLogMethod)
        {
            startLogMethod = endLogMethod = null;

            MethodRef tempStartLogMethod = methodLogger.GetMethod(startLogMethodName);
            MethodRef tempEndLogMethod   = methodLogger.GetMethod(endLogMethodName);

            if (tempStartLogMethod != null && tempEndLogMethod != null)
            {
                if (CheckLogMethodParameters(tempStartLogMethod.GetParTypes()) && CheckLogMethodParameters(tempEndLogMethod.GetParTypes()))
                {
                    startLogMethod = tempStartLogMethod;
                    endLogMethod   = tempEndLogMethod;
                    return(true);
                }
            }

            return(false);
        }