示例#1
0
        public static CachedOutput Create(CorFrame frame, TypePrinterFlags flags)
        {
            var output = new TypeOutput();

            frame.Write(output, flags);
            return(output.cachedOutput);
        }
示例#2
0
        static TypeOutput CreateType(TypeOutput output, CorValue value, TypePrinterFlags flags)
        {
            if (value == null)
            {
                output.Write("???", TypeColor.Error);
            }
            else
            {
                if (value.IsReference && value.Type == dndbg.Engine.COM.CorDebug.CorElementType.ByRef)
                {
                    value = value.NeuterCheckDereferencedValue ?? value;
                }

                var type = value.ExactType;
                if (type != null)
                {
                    type.Write(output, flags);
                }
                else
                {
                    var cls = value.Class;
                    if (cls != null)
                    {
                        cls.Write(output, flags);
                    }
                    else
                    {
                        output.Write("???", TypeColor.Error);
                    }
                }
            }
            return(output);
        }
示例#3
0
 TypePrinterFlags GetTypePrinterFlags(ILocalsSettings localsSettings, TypePrinterFlags flags)
 {
     Update(localsSettings.ShowNamespaces, TypePrinterFlags.ShowNamespaces, ref flags);
     Update(localsSettings.ShowTokens, TypePrinterFlags.ShowTokens, ref flags);
     Update(localsSettings.ShowTypeKeywords, TypePrinterFlags.ShowTypeKeywords, ref flags);
     return(flags);
 }
示例#4
0
        public override string ToString()
        {
            const TypePrinterFlags flags = TypePrinterFlags.ShowParameterTypes |
                                           TypePrinterFlags.ShowReturnTypes | TypePrinterFlags.ShowNamespaces |
                                           TypePrinterFlags.ShowTypeKeywords;

            return(debugger.Dispatcher.UI(() => evt.ToString(flags)));
        }
示例#5
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);
        }
示例#6
0
 static void Update(bool b, TypePrinterFlags f, ref TypePrinterFlags flags)
 {
     if (b)
     {
         flags |= f;
     }
     else
     {
         flags &= ~f;
     }
 }
示例#7
0
        public static CachedOutput CreateType(CorValue value, CorClass cls, TypePrinterFlags flags)
        {
            var valueOutput = CreateType(new TypeOutput(), value, flags);

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

            var typeOutput = value.WriteType(new TypeOutput(), cls, flags);

            return(CreateTypeInternal(valueOutput, typeOutput));
        }
示例#8
0
        public static CachedOutput Create(CorType type, TypePrinterFlags flags)
        {
            var output = new TypeOutput();

            if (type == null)
            {
                output.Write("???", TypeColor.Error);
            }
            else
            {
                type.Write(output, flags);
            }
            return(output.cachedOutput);
        }
示例#9
0
        public static CachedOutput CreateValue(CorValue value, TypePrinterFlags flags, Func <DnEval> getEval = null)
        {
            var output = new TypeOutput();

            if (value == null)
            {
                output.Write("???", TypeColor.Error);
            }
            else
            {
                value.Write(output, flags, getEval);
            }
            return(output.cachedOutput);
        }
示例#10
0
文件: CorValue.cs 项目: danysu/dnSpy
 public T WriteType <T>(T output, TypeSig ts, IList <CorType> typeArgs, IList <CorType> methodArgs, TypePrinterFlags flags, Func <DnEval> getEval = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags, getEval).Write(ts, typeArgs, methodArgs);
     return(output);
 }
示例#11
0
文件: CorValue.cs 项目: danysu/dnSpy
 public T WriteType <T>(T output, CorClass cls, TypePrinterFlags flags, Func <DnEval> getEval = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags, getEval).Write(cls);
     return(output);
 }
示例#12
0
 public static CachedOutput CreateConstant(TypeSig type, object c, TypePrinterFlags flags)
 {
     return(TypePrinterUtils.WriteConstant(new TypeOutput(), type, c, flags).cachedOutput);
 }
示例#13
0
 public string ToString(CorValue value, TypePrinterFlags flags)
 {
     return(Write(new StringBuilderTypeOutput(), value, flags).ToString());
 }
示例#14
0
 public static T Write <T>(this T output, TypeSig type, TypePrinterFlags flags, IList <CorType> typeGenArgs = null, IList <CorType> methGenArgs = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags).Write(type, typeGenArgs, methGenArgs);
     return(output);
 }
示例#15
0
 TypePrinterFlags GetTypePrinterFlags(IDebuggerSettings debuggerSettings, TypePrinterFlags flags)
 {
     Update(!debuggerSettings.UseHexadecimal, TypePrinterFlags.UseDecimal, ref flags);
     return(flags);
 }
示例#16
0
 public static string ConstantToString(object c, TypePrinterFlags flags)
 {
     return(WriteConstant(new StringBuilderTypeOutput(), c, flags).ToString());
 }
示例#17
0
 public string ToString(TypePrinterFlags flags) => Write(new StringBuilderTypeOutput(), flags).ToString();
示例#18
0
文件: CorValue.cs 项目: danysu/dnSpy
 public string ToString(TypePrinterFlags flags, Func <DnEval> getEval = null)
 {
     return(Write(new StringBuilderTypeOutput(), flags, getEval).ToString());
 }
示例#19
0
 public static string ConstantToString(TypeSig type, object c, TypePrinterFlags flags) => WriteConstant(new StringBuilderTypeOutput(), type, c, flags).ToString();
示例#20
0
 public static string ToString(CorElementType etype, TypePrinterFlags flags) => Write(new StringBuilderTypeOutput(), etype, flags).ToString();
示例#21
0
 public static T Write <T>(this T output, CorElementType etype, TypePrinterFlags flags) where T : ITypeOutput => Write(output, ToTypeSig(etype), flags);
示例#22
0
 public static string ToString(TypeSig type, TypePrinterFlags flags, IList <CorType> typeGenArgs = null, IList <CorType> methGenArgs = null) => Write(new StringBuilderTypeOutput(), type, flags, typeGenArgs, methGenArgs).ToString();
示例#23
0
 public T Write <T>(T output, TypePrinterFlags flags) where T : ITypeOutput
 {
     new TypePrinter(output, flags).Write(this);
     return(output);
 }
示例#24
0
 public static CachedOutput CreateType(CorValue value, TypePrinterFlags flags)
 {
     return(CreateType(new TypeOutput(), value, flags).cachedOutput);
 }
示例#25
0
文件: CorFrame.cs 项目: ottrur/dnSpy
 public string ToString(TypePrinterFlags flags)
 {
     return(Write(new StringBuilderTypeOutput(), flags).ToString());
 }
示例#26
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));
        }
示例#27
0
 public T Write <T>(T output, CorValue value, TypePrinterFlags flags, Func <DnEval> getEval = null) where T : ITypeOutput
 {
     new TypePrinter(output, flags, getEval).Write(value, this);
     return(output);
 }
示例#28
0
 public static T WriteConstant <T>(this T output, object c, TypePrinterFlags flags) where T : ITypeOutput
 {
     new TypePrinter(output, flags).WriteConstant(c);
     return(output);
 }
示例#29
0
 public T Write <T>(T output, TypeSig type, TypePrinterFlags flags) where T : ITypeOutput
 {
     new TypePrinter(output, flags).Write(type, TypeParameters.ToArray());
     return(output);
 }