示例#1
0
 /// <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);
 }
示例#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 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);
 }
示例#4
0
		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);
		}
示例#5
0
 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);
 }
示例#6
0
 /// <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);
 }
示例#7
0
 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);
 }
示例#8
0
 public void WriteType(ITextColorWriter output, ITypeDefOrRef type, bool includeNamespace, ParamDef?pd = null) => implementation.WriteType(output, type, includeNamespace, pd);
示例#9
0
		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);
		}
示例#10
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);
		}
示例#11
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);
		}
示例#12
0
		/// <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);
		}
示例#13
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);
		}
示例#14
0
		/// <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);
		}