예제 #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);
        }
예제 #2
0
        private static string GetFieldStringFromElement(CodeElement elem)
        {
            var v        = (CodeVariable)elem;
            var typeName = GenericNameMangler.MangleTypeName(GetTypeName(v.Parent));
            var oftype   = GetVariableType(v);

            return(oftype + " " + typeName + "::" + v.Name);
        }
예제 #3
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);
        }