Exemplo n.º 1
0
        EntityDeclaration ConvertOperator(IMethod op)
        {
            OperatorType? opType = OperatorDeclaration.GetOperatorType(op.Name);
            if (opType == null)
                return ConvertMethod(op);

            OperatorDeclaration decl = new OperatorDeclaration();
            decl.Modifiers = GetMemberModifiers(op);
            decl.OperatorType = opType.Value;
            decl.ReturnType = ConvertType(op.ReturnType);
            foreach (IParameter p in op.Parameters) {
                decl.Parameters.Add(ConvertParameter(p));
            }
            if (AddResolveResultAnnotations) {
                decl.AddAnnotation(new MemberResolveResult(null, op));
            }
            decl.Body = GenerateBodyBlock();
            return decl;
        }
Exemplo n.º 2
0
        EntityDeclaration ConvertOperator(IMethod op)
        {
            OperatorType? opType = OperatorDeclaration.GetOperatorType(op.Name);
            if (opType == null)
                return ConvertMethod(op);

            OperatorDeclaration decl = new OperatorDeclaration();
            decl.Modifiers = GetMemberModifiers(op);
            decl.OperatorType = opType.Value;
            decl.ReturnType = ConvertType(op.ReturnType);
            foreach (IParameter p in op.Parameters) {
                decl.Parameters.Add(ConvertParameter(p));
            }
            if (AddResolveResultAnnotations) {
                decl.AddAnnotation(new MemberResolveResult(null, op));
            }
            decl.Body = GenerateBodyBlock();
            return decl;
        }