/// <summary> /// Writes a property /// </summary> /// <param name="output">Output</param> /// <param name="decompiler">Decompiler</param> /// <param name="property">Property</param> /// <param name="showToken">true to write tokens</param> /// <param name="isIndexer">true if it's an indexer</param> public void Write(ITextColorWriter output, IDecompiler decompiler, PropertyDef property, bool showToken, bool?isIndexer) { decompiler.WriteName(output, property, isIndexer); output.WriteSpace(); output.Write(BoxedTextColor.Punctuation, ":"); output.WriteSpace(); decompiler.WriteType(output, property.PropertySig.GetRetType().ToTypeDefOrRef(), false); WriteToken(output, property, showToken); }
/// <summary> /// Writes a field /// </summary> /// <param name="output">Output</param> /// <param name="decompiler">Decompiler</param> /// <param name="field">Field</param> /// <param name="showToken">true to write tokens</param> public void Write(ITextColorWriter output, IDecompiler decompiler, FieldDef field, bool showToken) { output.Write(decompiler.MetadataTextColorProvider.GetColor(field), NameUtilities.CleanIdentifier(field.Name)); output.WriteSpace(); output.Write(BoxedTextColor.Punctuation, ":"); output.WriteSpace(); decompiler.WriteType(output, field.FieldType.ToTypeDefOrRef(), false); WriteToken(output, field, showToken); }
/// <summary> /// Writes an event /// </summary> /// <param name="output">Output</param> /// <param name="decompiler">Decompiler</param> /// <param name="event">Event</param> /// <param name="showToken">true to write tokens</param> public void Write(ITextColorWriter output, IDecompiler decompiler, EventDef @event, bool showToken) { output.Write(decompiler.MetadataTextColorProvider.GetColor(@event), NameUtilities.CleanIdentifier(@event.Name)); output.WriteSpace(); output.Write(BoxedTextColor.Punctuation, ":"); output.WriteSpace(); decompiler.WriteType(output, @event.EventType, false); WriteToken(output, @event, showToken); }
protected override void Write(ITextColorWriter output, IDecompiler decompiler) { if (hidesParent) { output.Write(BoxedTextColor.Punctuation, "("); output.Write(BoxedTextColor.Text, dnSpy_Analyzer_Resources.HidesParent); output.Write(BoxedTextColor.Punctuation, ")"); output.WriteSpace(); } decompiler.WriteType(output, analyzedProperty.DeclaringType, true); output.Write(BoxedTextColor.Operator, "."); new NodePrinter().Write(output, decompiler, analyzedProperty, Context.ShowToken, null); }
protected override void Write(ITextColorWriter output, IDecompiler decompiler) { if (hidesParent) { output.Write(BoxedTextColor.Punctuation, "("); output.Write(BoxedTextColor.Text, dnSpy_Analyzer_Resources.HidesParent); output.Write(BoxedTextColor.Punctuation, ")"); output.WriteSpace(); } decompiler.WriteType(output, analyzedMethod.DeclaringType, true); output.Write(BoxedTextColor.Operator, "."); new NodeFormatter().Write(output, decompiler, analyzedMethod, Context.ShowToken); }
/// <summary> /// Writes a type /// </summary> /// <param name="output">Output</param> /// <param name="decompiler">Decompiler</param> /// <param name="type">Type</param> /// <param name="showToken">true to write tokens</param> public void Write(ITextColorWriter output, IDecompiler decompiler, ITypeDefOrRef type, bool showToken) { decompiler.WriteType(output, type, false); WriteToken(output, type, showToken); }
protected override void Write(ITextColorWriter output, IDecompiler decompiler) { decompiler.WriteType(output, analyzedField.DeclaringType, true); output.Write(BoxedTextColor.Operator, "."); new NodePrinter().Write(output, decompiler, analyzedField, Context.ShowToken); }
public void WriteType(ITextColorWriter output, ITypeDefOrRef type, bool includeNamespace, ParamDef?pd = null) => implementation.WriteType(output, type, includeNamespace, pd);
/// <summary> /// Writes a method /// </summary> /// <param name="output">Output</param> /// <param name="decompiler">Decompiler</param> /// <param name="method">Method</param> /// <param name="showToken">true to write tokens</param> public void Write(ITextColorWriter output, IDecompiler decompiler, MethodDef method, bool showToken) { output.Write(decompiler.MetadataTextColorProvider.GetColor(method), NameUtilities.CleanIdentifier(method.Name)); output.Write(BoxedTextColor.Punctuation, "("); foreach (var p in method.Parameters) { if (p.IsHiddenThisParameter) continue; if (p.MethodSigIndex > 0) output.WriteCommaSpace(); decompiler.WriteType(output, p.Type.ToTypeDefOrRef(), false, p.ParamDef); } if (method.CallingConvention == CallingConvention.VarArg || method.CallingConvention == CallingConvention.NativeVarArg) { if (method.MethodSig.GetParamCount() > 0) output.WriteCommaSpace(); output.Write(BoxedTextColor.Operator, "..."); } output.Write(BoxedTextColor.Punctuation, ")"); output.WriteSpace(); output.Write(BoxedTextColor.Punctuation, ":"); output.WriteSpace(); decompiler.WriteType(output, method.ReturnType.ToTypeDefOrRef(), false, method.Parameters.ReturnParameter.ParamDef); WriteToken(output, method, showToken); }
/// <summary> /// Writes a property /// </summary> /// <param name="output">Output</param> /// <param name="decompiler">Decompiler</param> /// <param name="property">Property</param> /// <param name="showToken">true to write tokens</param> /// <param name="isIndexer">true if it's an indexer</param> public void Write(ITextColorWriter output, IDecompiler decompiler, PropertyDef property, bool showToken, bool? isIndexer) { decompiler.WriteName(output, property, isIndexer); output.WriteSpace(); output.Write(BoxedTextColor.Punctuation, ":"); output.WriteSpace(); decompiler.WriteType(output, property.PropertySig.GetRetType().ToTypeDefOrRef(), false); WriteToken(output, property, showToken); }