示例#1
0
 /// <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);
 }
示例#2
0
 /// <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);
 }
示例#3
0
 /// <summary>
 /// Writes a field
 /// </summary>
 /// <param name="output">Output</param>
 /// <param name="language">Language</param>
 /// <param name="field">Field</param>
 /// <param name="showToken">true to write tokens</param>
 public void Write(ITextColorWriter output, ILanguage language, FieldDef field, bool showToken)
 {
     output.Write(TextColorHelper.GetColor(field), NameUtilities.CleanIdentifier(field.Name));
     output.WriteSpace();
     output.Write(BoxedTextColor.Punctuation, ":");
     output.WriteSpace();
     language.WriteType(output, field.FieldType.ToTypeDefOrRef(), false);
     WriteToken(output, field, showToken);
 }
示例#4
0
 /// <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);
 }
示例#5
0
 /// <summary>
 /// Writes an event
 /// </summary>
 /// <param name="output">Output</param>
 /// <param name="language">Language</param>
 /// <param name="event">Event</param>
 /// <param name="showToken">true to write tokens</param>
 public void Write(ITextColorWriter output, ILanguage language, EventDef @event, bool showToken)
 {
     output.Write(TextColorHelper.GetColor(@event), NameUtilities.CleanIdentifier(@event.Name));
     output.WriteSpace();
     output.Write(BoxedTextColor.Punctuation, ":");
     output.WriteSpace();
     language.WriteType(output, @event.EventType, false);
     WriteToken(output, @event, showToken);
 }
示例#6
0
 /// <summary>
 /// Writes a module reference
 /// </summary>
 /// <param name="output">Output</param>
 /// <param name="decompiler">Decompiler</param>
 /// <param name="modRef">Module reference</param>
 /// <param name="showToken">true to write tokens</param>
 public void Write(ITextColorWriter output, IDecompiler decompiler, ModuleRef modRef, bool showToken)
 {
     output.Write(BoxedTextColor.Text, NameUtilities.CleanIdentifier(modRef.Name));
     WriteToken(output, modRef, showToken);
 }
示例#7
0
 /// <summary>
 /// Writes an assembly reference
 /// </summary>
 /// <param name="output">Output</param>
 /// <param name="decompiler">Decompiler</param>
 /// <param name="asmRef">Assembly reference</param>
 /// <param name="showToken">true to write tokens</param>
 public void Write(ITextColorWriter output, IDecompiler decompiler, AssemblyRef asmRef, bool showToken)
 {
     output.Write(BoxedTextColor.Text, NameUtilities.CleanIdentifier(asmRef.Name));
     WriteToken(output, asmRef, showToken);
 }
示例#8
0
 protected override void Write(ITextColorWriter output, ILanguage language) =>
 output.Write(BoxedTextColor.Module, NameUtilities.CleanIdentifier(module.Name));
示例#9
0
 protected override void Write(ITextColorWriter output, IDecompiler decompiler) =>
 output.Write(BoxedTextColor.AssemblyModule, NameUtilities.CleanIdentifier(module.Name));