Example #1
0
            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);
                }
            }
Example #2
0
            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);
            }
Example #3
0
 protected override void VisitField(VBMember node)
 {
     Prefix("F:");
     base.VisitField(node);
 }
Example #4
0
 protected override void VisitEvent(VBMember node)
 {
     Prefix("E:");
     base.VisitEvent(node);
 }
Example #5
0
 protected override void VisitEnumMember(VBMember node)
 {
     Prefix("F:");
     base.VisitEnumMember(node);
 }
Example #6
0
 protected override void VisitConstructor(VBMember node)
 {
     Prefix("M:");
     base.VisitConstructor(node);
 }
Example #7
0
 protected override void VisitSetAccessor(VBMember node)
 {
     VisitIfNotNull(node.ContainingMember);
 }
Example #8
0
 protected override void VisitRemoveHandlerAccessor(VBMember node)
 {
     VisitIfNotNull(node.ContainingMember);
 }
Example #9
0
 protected override void VisitEvent(VBMember node)
 {
     Prefix("E:");
     base.VisitEvent(node);
 }
Example #10
0
 protected override void VisitMethod(VBMember node)
 {
     Prefix("M:");
     base.VisitMethod(node);
 }
Example #11
0
 protected override void VisitConstructor(VBMember node)
 {
     Prefix("M:");
     base.VisitConstructor(node);
 }
Example #12
0
 protected override void VisitProperty(VBMember node)
 {
     Prefix("P:");
     base.VisitProperty(node);
 }
Example #13
0
 protected override void VisitField(VBMember node)
 {
     Prefix("F:");
     base.VisitField(node);
 }
Example #14
0
 protected override void VisitEnumMember(VBMember node)
 {
     Prefix("F:");
     base.VisitEnumMember(node);
 }
Example #15
0
 protected override void VisitMethod(VBMember node)
 {
     Prefix("M:");
     base.VisitMethod(node);
 }
Example #16
0
 protected override void VisitProperty(VBMember node)
 {
     Prefix("P:");
     base.VisitProperty(node);
 }
Example #17
0
        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);
        }
Example #18
0
 protected override void VisitSetAccessor(VBMember node)
 {
     VisitIfNotNull(node.ContainingMember);
 }
Example #19
0
 protected override void VisitRemoveHandlerAccessor(VBMember node)
 {
     VisitIfNotNull(node.ContainingMember);
 }