public void Append(CSTWriter w) { switch (w.Style) { case WriterStyle.ReflectionName: { w.AppendName(Types[Types.Count - 1]); break; } case WriterStyle.ReflectionFullName: case WriterStyle.Uniform: case WriterStyle.Debug: { if (!string.IsNullOrEmpty(Namespace)) { w.AppendName(Namespace); w.Append('.'); } for (var i = 0; i < Types.Count; i++) { if (i > 0) { w.Append('+'); } w.AppendName(Types[i]); } break; } } }
public void Append(CSTWriter w) { // Print from bottom to top to match argument order w.Append("{["); for (var i = Depth - 1; i >= 0; i--) { if (i < Depth - 1) { w.Append(','); } if (innerState.Value.Ids != null) { w.AppendName(innerState.Value.Ids[i].Value); w.Append(':'); } innerState.Value.Stack[i].Append(w); } w.Append(']'); if (!innerState.Value.ArgsLocalsState.IsBottom) { w.Append(' '); innerState.Value.ArgsLocalsState.Append(w); } w.Append('}'); }
public override void Append(CSTWriter w, IImSeq <TypeRef> methodTypeArguments) { if (methodTypeArguments != null) { throw new InvalidOperationException("signature does not accept type arguments"); } w.Append("event "); w.AppendName(Name); }
// // Pretty printing // public virtual void AppendDefinition(CSTWriter w) { foreach (var annotation in CustomAttributes) { annotation.Append(w); w.EndLine(); } AppendFlavor(w); w.Append(IsStatic ? "static " : "instance "); AppendModifiers(w); w.AppendName(Name); }
public override void Append(CSTWriter w) { if (Object == null) { Field.DefiningType.Append(w); } else { Object.Append(w, 1); } w.Append('.'); w.AppendName(Field.Name); }
public void Append(CSTWriter w) { switch (w.Style) { case WriterStyle.ReflectionFullName: case WriterStyle.Uniform: w.Append('['); Assembly.Append(w); w.Append(']'); Type.Append(w); break; case WriterStyle.ReflectionName: // no assembly Type.Append(w); break; case WriterStyle.Debug: { // elide *mscorlib, elide assembly version etc if (Assembly.Name == null) { w.Append('['); w.Append(AssemblyName.unavailableSimpleName); w.Append(']'); } else if (!Assembly.Name.Contains(Global.MSCorLibSimpleName)) { w.Append('['); w.AppendName(Assembly.Name); w.Append(']'); } // shorten the built-in type names var nm = default(string); if (w.Global.TypeNameToAbbreviation.TryGetValue(Type, out nm) && nm != null) { w.Append(nm); } else { Type.Append(w); } break; } default: throw new ArgumentOutOfRangeException(); } }
public override void Append(CSTWriter w, IImSeq <TypeRef> methodTypeArguments) { w.Append("method "); w.Append(IsStatic ? "static " : "instance "); w.AppendName(Name); if (methodTypeArguments != null) { if (methodTypeArguments.Count > 0) { w.Append('<'); for (var i = 0; i < methodTypeArguments.Count; i++) { if (i > 0) { w.Append(','); } methodTypeArguments[i].Append(w); } w.Append('>'); } } else { if (TypeArity > 0) { w.Append("<["); w.Append(TypeArity); w.Append("]>"); } } w.Append('('); for (var i = 0; i < Parameters.Count; i++) { if (i > 0) { w.Append(','); } Parameters[i].Append(w); } w.Append(')'); if (Result != null) { w.Append(':'); Result.Append(w); } }
public void Append(CSTWriter w) { w.AppendName(Name ?? unavailableSimpleName); if (w.Global.AssemblyNameResolution == AssemblyNameResolution.Full || w.Global.AssemblyNameResolution == AssemblyNameResolution.NameVersion) { w.Append(", Version="); w.Append(MajorVersion); w.Append('.'); w.Append(MinorVersion); w.Append('.'); w.Append(BuildNumber); w.Append('.'); w.Append(RevisionNumber); } if (w.Global.AssemblyNameResolution == AssemblyNameResolution.Full) { w.Append(", Culture="); w.Append(string.IsNullOrEmpty(Culture) ? defaultCulture : Culture); } if (w.Global.AssemblyNameResolution == AssemblyNameResolution.Full) { w.Append(", PublicKeyToken="); if (PublicKeyToken == null) { w.Append(defaultPublicKeyToken); } else { for (var i = 0; i < PublicKeyToken.Length; i++) { var v = PublicKeyToken[i]; for (var j = 0; j < 2; j++) { var d = v >> 4; w.Append(d < 10 ? '0' + d : 'a' + (d - 10)); v <<= 4; } } } } }
public override void Append(CSTWriter w, IImSeq <TypeRef> methodTypeArguments) { if (methodTypeArguments != null) { throw new InvalidOperationException("signature does not accept type arguments"); } w.Append("property "); w.Append(IsStatic ? "static " : "instance "); w.AppendName(Name); w.Append('('); for (var i = 0; i < Parameters.Count; i++) { if (i > 0) { w.Append(','); } Parameters[i].Append(w); } w.Append(')'); w.Append(':'); Result.Append(w); }
public void Append(CSTWriter w) { w.AppendName(Id.Value); w.Append(':'); Type.Append(w); }
public override void Append(CSTWriter w) { w.AppendName(Id.Value); }