Ejemplo n.º 1
0
        protected override void AddLinkItems(INamedTypeSymbol symbol, bool withGenericeParameter)
        {
            var id = VisitorHelper.GetId(symbol);

            if (withGenericeParameter)
            {
                ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem
                {
                    DisplayName           = NameVisitorCreator.GetVB(NameOptions.WithGenericParameter).GetName(symbol),
                    DisplayQualifiedNames = NameVisitorCreator.GetVB(NameOptions.Qualified | NameOptions.WithGenericParameter).GetName(symbol),
                    Name           = id,
                    IsExternalPath = symbol.IsExtern || symbol.DeclaringSyntaxReferences.Length == 0,
                });
            }
            else
            {
                ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem
                {
                    DisplayName           = NameVisitorCreator.GetVB(NameOptions.None).GetName(symbol),
                    DisplayQualifiedNames = NameVisitorCreator.GetVB(NameOptions.Qualified).GetName(symbol),
                    Name           = id,
                    IsExternalPath = symbol.IsExtern || symbol.DeclaringSyntaxReferences.Length == 0,
                });
            }
        }
Ejemplo n.º 2
0
        public override void VisitMethod(IMethodSymbol symbol)
        {
            var id = VisitorHelper.GetId(symbol.OriginalDefinition);

            ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem
            {
                DisplayName           = NameVisitorCreator.GetVB(NameOptions.WithGenericParameter).GetName(symbol),
                DisplayQualifiedNames = NameVisitorCreator.GetVB(NameOptions.Qualified | NameOptions.WithGenericParameter).GetName(symbol),
                Name           = id,
                IsExternalPath = symbol.IsExtern || symbol.DeclaringSyntaxReferences.Length == 0,
            });
            ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem
            {
                DisplayName           = "(",
                DisplayQualifiedNames = "(",
            });
            for (int i = 0; i < symbol.Parameters.Length; i++)
            {
                if (i > 0)
                {
                    ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem
                    {
                        DisplayName           = ", ",
                        DisplayQualifiedNames = ", ",
                    });
                }
                symbol.Parameters[i].Type.Accept(this);
            }
            ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem
            {
                DisplayName           = ")",
                DisplayQualifiedNames = ")",
            });
        }
Ejemplo n.º 3
0
 public override void VisitNamespace(INamespaceSymbol symbol)
 {
     ReferenceItem.Parts[SyntaxLanguage.CSharp].Add(new LinkItem
     {
         DisplayName           = NameVisitorCreator.GetCSharp(NameOptions.None).GetName(symbol),
         DisplayQualifiedNames = NameVisitorCreator.GetCSharp(NameOptions.Qualified).GetName(symbol),
     });
 }
Ejemplo n.º 4
0
        public override void VisitField(IFieldSymbol symbol)
        {
            var id = VisitorHelper.GetId(symbol.OriginalDefinition);

            ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem
            {
                DisplayName           = NameVisitorCreator.GetVB(NameOptions.WithGenericParameter).GetName(symbol),
                DisplayQualifiedNames = NameVisitorCreator.GetVB(NameOptions.Qualified | NameOptions.WithGenericParameter).GetName(symbol),
                Name           = id,
                IsExternalPath = symbol.IsExtern || symbol.DeclaringSyntaxReferences.Length == 0,
            });
        }
Ejemplo n.º 5
0
 private static string GetEiiContainerTypeName(IPropertySymbol symbol)
 {
     if (symbol.ExplicitInterfaceImplementations.Length == 0)
     {
         return(null);
     }
     for (int i = 0; i < symbol.ExplicitInterfaceImplementations.Length; i++)
     {
         if (VisitorHelper.CanVisit(symbol.ExplicitInterfaceImplementations[i]))
         {
             return(NameVisitorCreator.GetCSharp(NameOptions.UseAlias | NameOptions.WithGenericParameter).GetName(symbol.ExplicitInterfaceImplementations[i].ContainingType));
         }
     }
     Debug.Fail("Should not be here!");
     return(null);
 }
Ejemplo n.º 6
0
        private static NameSyntax GetQualifiedNameSyntax(ITypeSymbol type)
        {
            var name = NameVisitorCreator.GetVB(NameOptions.UseAlias | NameOptions.WithGenericParameter).GetName(type);

            return(SyntaxFactory.ParseName(name));
        }
Ejemplo n.º 7
0
 public override void DefaultVisit(ISymbol symbol, MetadataItem item, SymbolVisitorAdapter adapter)
 {
     item.DisplayNames[SyntaxLanguage.VB]          = NameVisitorCreator.GetVB(NameOptions.WithGenericParameter | NameOptions.WithParameter).GetName(symbol);
     item.DisplayQualifiedNames[SyntaxLanguage.VB] = NameVisitorCreator.GetVB(NameOptions.Qualified | NameOptions.WithGenericParameter | NameOptions.WithParameter).GetName(symbol);
 }