コード例 #1
0
        public static CachedOutput Create(TypeSig fieldType, TypePrinterFlags flags)
        {
            fieldType = fieldType.RemovePinnedAndModifiers() ?? fieldType;
            if (fieldType is ByRefSig)
            {
                fieldType = fieldType.Next ?? fieldType;
            }
            var typeOutput = TypePrinterUtils.Write(new TypeOutput(), fieldType, flags);

            return(typeOutput.cachedOutput);
        }
コード例 #2
0
        public static CachedOutput CreateType(CorValue value, TypeSig ts, IList <CorType> typeArgs, IList <CorType> methodArgs, TypePrinterFlags flags)
        {
            if (value == null && ts != null)
            {
                return(TypePrinterUtils.Write(new TypeOutput(), ts, flags, typeArgs, methodArgs).cachedOutput);
            }
            var valueOutput = CreateType(new TypeOutput(), value, flags);

            if (ts == null || value == null)
            {
                return(valueOutput.cachedOutput);
            }

            ts = ts.RemovePinnedAndModifiers() ?? ts;
            if (ts is ByRefSig)
            {
                ts = ts.Next ?? ts;
            }

            var typeOutput = value.WriteType(new TypeOutput(), ts, typeArgs, methodArgs, flags);

            return(CreateTypeInternal(valueOutput, typeOutput));
        }