コード例 #1
0
 protected override void VisitParameter(VBParameter node)
 {
     VisitIfNotNull(node.ParameterType);
     if (node.IsByRef)
     {
         Code.Append("@");
     }
 }
コード例 #2
0
ファイル: VBResolver.cs プロジェクト: jerriclynsjohn/Ref12
 protected override void VisitParameter(VBParameter node)
 {
     VisitIfNotNull(node.ParameterType);
     if (node.IsByRef)
         Code.Append("@");
 }
コード例 #3
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);
        }