Exemplo n.º 1
0
        protected static void AddParametersToId(Context cx, EscapingTextWriter trapFile, IMethodSymbol method)
        {
            trapFile.Write('(');
            var index = 0;

            var @params = method.Parameters;

            foreach (var param in @params)
            {
                trapFile.WriteSeparator(",", ref index);
                param.Type.BuildOrWriteId(cx, trapFile, method);
                trapFile.Write(" ");
                trapFile.Write(param.Name);
                switch (param.RefKind)
                {
                case RefKind.Out:
                    trapFile.Write(" out");
                    break;

                case RefKind.Ref:
                    trapFile.Write(" ref");
                    break;
                }
            }

            if (method.IsVararg)
            {
                trapFile.WriteSeparator(",", ref index);
                trapFile.Write("__arglist");
            }

            trapFile.Write(')');
        }
Exemplo n.º 2
0
        public override void WriteId(EscapingTextWriter trapFile)
        {
            unboundMethod.WriteId(trapFile);
            trapFile.Write('<');
            var index = 0;

            foreach (var param in typeParams)
            {
                trapFile.WriteSeparator(",", ref index);
                trapFile.WriteSubId(param);
            }
            trapFile.Write('>');
        }
Exemplo n.º 3
0
            public void WriteId(EscapingTextWriter trapFile, IGenericContext gc)
            {
                genericType.WriteId(trapFile, gc);
                trapFile.Write('<');
                var index = 0;

                foreach (var arg in typeArguments)
                {
                    trapFile.WriteSeparator(",", ref index);
                    arg.WriteId(trapFile, gc);
                }
                trapFile.Write('>');
            }
Exemplo n.º 4
0
        public override void WriteId(EscapingTextWriter trapFile)
        {
            trapFile.WriteSubId(type);
            trapFile.Write('.');
            trapFile.Write(Context.GetString(pd.Name));
            trapFile.Write("(");
            var index     = 0;
            var signature = pd.DecodeSignature(new SignatureDecoder(), gc);

            foreach (var param in signature.ParameterTypes)
            {
                trapFile.WriteSeparator(",", ref index);
                param.WriteId(trapFile, gc);
            }
            trapFile.Write(")");
            trapFile.Write(";cil-property");
        }
Exemplo n.º 5
0
        public void WriteId(EscapingTextWriter trapFile, bool inContext)
        {
            if (type.IsPrimitiveType)
            {
                Type.WritePrimitiveTypeId(trapFile, type.Name);
                return;
            }

            var ct = type.ContainingType;

            if (ct is not null)
            {
                ct.WriteId(trapFile, inContext);
                trapFile.Write('.');
            }
            else
            {
                type.WriteAssemblyPrefix(trapFile);

                var ns = type.ContainingNamespace !;
                if (!ns.IsGlobalNamespace)
                {
                    ns.WriteId(trapFile);
                    trapFile.Write('.');
                }
            }

            trapFile.Write(type.Name);

            var thisTypeArguments = type.ThisTypeArguments;

            if (thisTypeArguments is not null && thisTypeArguments.Any())
            {
                trapFile.Write('<');
                var index = 0;
                foreach (var t in thisTypeArguments)
                {
                    trapFile.WriteSeparator(",", ref index);
                    t.WriteId(trapFile);
                }
                trapFile.Write('>');
            }
Exemplo n.º 6
0
        public override void WriteId(EscapingTextWriter trapFile)
        {
            signature.ReturnType.WriteId(trapFile, this);
            trapFile.Write(' ');
            DeclaringType.WriteId(trapFile);
            trapFile.Write('.');
            trapFile.Write(NameLabel);

            if (signature.GenericParameterCount > 0)
            {
                trapFile.Write('`');
                trapFile.Write(signature.GenericParameterCount);
            }
            trapFile.Write('(');
            var index = 0;

            foreach (var param in signature.ParameterTypes)
            {
                trapFile.WriteSeparator(",", ref index);
                param.WriteId(trapFile, this);
            }
            trapFile.Write(");cil-method");
        }