protected override void VisitMember(VBMember node) { VisitBaseQualifier(node.ContainingType); inCoreType = false; string text; if (node.IsConstructor) { text = "ctor"; // IndexId uses "ctor", not "#ctor" } else if (node.IsProperty && node.IsDefault) { text = "Item"; // TODO: Test indexer } else { text = node.Name; int count = node.TypeParameters.Count; if (count > 0) { text = text + "``" + count; } } Code.Append(text); if (node.Parameters.Any() && !node.IsEvent) // Events cannot be overloaded, so they don't need signatures { VisitParameters(node.Parameters); } }
protected override void VisitMember(VBMember node) { VisitBaseQualifier(node.ContainingType); inCoreType = false; string text; if (node.IsConstructor) { text = "ctor"; // IndexId uses "ctor", not "#ctor" } else if (node.IsProperty && node.IsDefault) { text = "Item"; // TODO: Test indexer } else { text = node.Name; int count = node.TypeParameters.Count; if (count > 0) { text = text + "``" + count; } } Code.Append(text); if (node.Parameters.Any() && !node.IsEvent) // Events cannot be overloaded, so they don't need signatures VisitParameters(node.Parameters); }
protected override void VisitField(VBMember node) { Prefix("F:"); base.VisitField(node); }
protected override void VisitEvent(VBMember node) { Prefix("E:"); base.VisitEvent(node); }
protected override void VisitEnumMember(VBMember node) { Prefix("F:"); base.VisitEnumMember(node); }
protected override void VisitConstructor(VBMember node) { Prefix("M:"); base.VisitConstructor(node); }
protected override void VisitSetAccessor(VBMember node) { VisitIfNotNull(node.ContainingMember); }
protected override void VisitRemoveHandlerAccessor(VBMember node) { VisitIfNotNull(node.ContainingMember); }
protected override void VisitMethod(VBMember node) { Prefix("M:"); base.VisitMethod(node); }
protected override void VisitProperty(VBMember node) { Prefix("P:"); base.VisitProperty(node); }
private static string ToIndexId(Symbol symbol, ISourceFile file) { VBParameter vBParameter = symbol as VBParameter; if (vBParameter != null) { return(null); } VBMember vBMember = symbol as VBMember; if (vBMember != null) { if (vBMember.IsFunctionResultLocal) { return(null); } while (vBMember.ContainingMember != null) { vBMember = vBMember.ContainingMember; } if (vBMember.IsProperty && vBMember.Name == "Value" && vBMember.ContainingType != null && vBMember.ContainingType.Name == "InternalXmlHelper") { return(null); // "vb.XmlPropertyExtensionValue"; } if (vBMember.IsProperty && vBMember.SourceFile != null && vBMember.SourceFile.IsSolutionExtension) { if (vBMember.Name == "Computer") { return("T:Microsoft.VisualBasic.Devices." + vBMember.Name); } if (vBMember.Name == "User") { return("T:Microsoft.VisualBasic.ApplicationServices." + vBMember.Name); } if (vBMember.Name == "Application") { return(null); //"My." + vBMember.Name; } if (vBMember.ReturnType != null && vBMember.ReturnType.BaseClass != null) { return("T:Microsoft.VisualBasic.ApplicationServices." + vBMember.ReturnType.BaseClass.Name); } return(null); //"My." + vBMember.Name; } else { if (vBMember.IsSynthetic || (vBMember.IsField && vBMember.SourceFile != null)) { symbol = vBMember.ReturnType; } else { VBType containingType = vBMember.ContainingType; if (containingType != null && (containingType.IsAnonymousType || containingType.IsAnonymousDelegate)) { return(null); // "vb.AnonymousType"; } } } } VBType vBType = symbol as VBType; while (vBType != null) { if (vBType.IsArray || vBType.IsPointer) { vBType = vBType.ElementType; } else { if (vBType.DefiningType == null) { break; } vBType = vBType.DefiningType; if (vBType == file.Host.RuntimeInfo.NullableType) { return(null); //"vb.Nullable"; } } } if (vBType != null) { if (vBType.IsPrimitive) { return("T:System." + vBType.TypeCode.ToString()); // "vb." + vBType.Name; } if (vBType.IsAnonymousType || vBType.IsAnonymousDelegate) { return(null); //"vb.AnonymousType"; } if (vBType == file.Binder.ResolveType("System.Runtime.CompilerServices.ExtensionAttribute", 0)) { return(null); //"vb.ExtensionMethods"; } } if (symbol is VBNamespace) { return(null); } if (symbol != null) { // CodeBuilder adds unavoidable spaces; IndexIds never have spaces. return(symbol.ToString(new IndexIdSymbolFormatter()).Replace(" ", "")); } return(null); }