Exemplo n.º 1
0
        private static string GetMethodName(CodeFunction function)
        {
            var    typeName = GetTypeName(function.Parent);
            var    typename = GenericNameMangler.MangleTypeName(typeName);
            string method;

            switch (function.FunctionKind)
            {
            case vsCMFunction.vsCMFunctionConstructor:
                method = function.IsShared ? ".cctor" : ".ctor";
                break;

            case vsCMFunction.vsCMFunctionDestructor:
                method = "Finalize";
                break;

            case vsCMFunction.vsCMFunctionPropertyGet:
                method = "get_" + function.Name;
                break;

            case vsCMFunction.vsCMFunctionPropertySet:
                method = "set_" + function.Name;
                break;

            default:
                method = GenericNameMangler.MangleMethodName(function.Name);
                break;
            }
            AutoTest.Core.DebugLog.Debug.WriteDebug("Method name is " + typename + "::" + method);
            return(typename + "::" + method);
        }
Exemplo n.º 2
0
        private static string GetMethodName(CodeFunction function)
        {
            var    typeName = GetTypeName(function.Parent);
            var    typename = GenericNameMangler.MangleTypeName(typeName);
            string method;

            switch (function.FunctionKind)
            {
            case vsCMFunction.vsCMFunctionConstructor:
                method = function.IsShared ? ".cctor" : ".ctor";
                break;

            case vsCMFunction.vsCMFunctionDestructor:
                method = "Finalize";
                break;

            case vsCMFunction.vsCMFunctionPropertyGet:
                method = "get_" + function.Name;
                break;

            case vsCMFunction.vsCMFunctionPropertySet:
                method = "set_" + function.Name;
                break;

            case vsCMFunction.vsCMFunctionOperator:
                string translated;
                ops.TryGetValue(function.Name.Replace("operator ", ""), out translated);
                method = translated;
                break;

            default:
                method = GenericNameMangler.MangleMethodName(function.Name);
                break;
            }
            return(typename + "::" + method);
        }