Esempio n. 1
0
 public EntityItem(INamespaceSymbol entity)
 {
     this.IsInSamePart    = true;
     this.entityNamespace = entity;
     text  = entity.Name;
     image = CompletionControls.GetImageData(entity).Source;
 }
Esempio n. 2
0
            public EntityItem(MemberDeclarationSyntax entity)
            {
                this.IsInSamePart = true;
                this.entity       = entity;

                if (entity is TypeDeclarationSyntax)
                {
                    text = ((TypeDeclarationSyntax)entity).Identifier.ToString();
                }
                else if (entity is ConstructorDeclarationSyntax)
                {
                    text = ((ConstructorDeclarationSyntax)entity).Identifier.ToString();
                }
                else if (entity is MethodDeclarationSyntax)
                {
                    text = ((MethodDeclarationSyntax)entity).Identifier.ToString();
                }
                else if (entity is PropertyDeclarationSyntax)
                {
                    text = ((PropertyDeclarationSyntax)entity).Identifier.ToString();
                }
                else if (entity is FieldDeclarationSyntax)
                {
                    FieldDeclarationSyntax f = ((FieldDeclarationSyntax)entity);
                    if (f.Declaration.Variables != null)
                    {
                        if (f.Declaration.Variables.Count > 0)
                        {
                            text = f.Declaration.Variables[0].Identifier.ToString();
                        }
                    }
                }
                else if (entity is NamespaceDeclarationSyntax)
                {
                    text = ((NamespaceDeclarationSyntax)entity).Name.ToString();
                }
                image = CompletionControls.GetImageData(entity).Source;
            }