public TypeTreeViewItem(IDocumentService documentService, TypeDef type) { this.documentService = documentService; this.Type = type; var texts = new List <TextRun>(); DecompileFormatUtil.AddTexts(this.Type, texts); this.Texts = texts; }
private IReadOnlyList <TextRun> BuildTexts() { var texts = new List <TextRun>(); texts.Add(new TextRun(this.Property.Name.String, this.Property.PropertySig.HasThis ? "d-iproperty" : "d-sproperty")); texts.Add(new TextRun(" : ")); DecompileFormatUtil.AddTexts(this.Property.PropertySig.RetType, texts); return(texts); }
private IReadOnlyList <TextRun> BuildTexts() { var texts = new List <TextRun>(); texts.Add(new TextRun(this.Method.Name.String, this.Method.IsStatic ? "d-smethod" : "d-imethod")); texts.Add(new TextRun("(")); var isFirst = true; foreach (var param in this.Method.Parameters) { if (!param.IsNormalMethodParameter) { continue; } if (isFirst) { isFirst = false; } else { texts.Add(new TextRun(", ")); } var type = param.Type; if (type.IsByRef) { if (!param.ParamDef.IsIn && param.ParamDef.IsOut) { texts.Add(new TextRun("out ", "d-keyword")); } else { texts.Add(new TextRun("ref ", "d-keyword")); } type = type.Next; } DecompileFormatUtil.AddTexts(type, texts); } texts.Add(new TextRun(") : ")); DecompileFormatUtil.AddTexts(Method.ReturnType, texts); return(texts); }
private IReadOnlyList <TextRun> BuildTexts() { var texts = new List <TextRun>(); string cssClass; if (this.Field.DeclaringType.IsEnum) { cssClass = "d-efield"; } else { cssClass = this.Field.FieldSig.HasThis ? "d-ifield" : "d-sfield"; } texts.Add(new TextRun(this.Field.Name.String, cssClass)); texts.Add(new TextRun(" : ")); DecompileFormatUtil.AddTexts(this.Field.FieldSig.Type, texts); return(texts); }