当前位置: 首页>>代码示例>>C#>>正文


C# INamedTypeSymbol.GetTypeMembers方法代码示例

本文整理汇总了C#中INamedTypeSymbol.GetTypeMembers方法的典型用法代码示例。如果您正苦于以下问题:C# INamedTypeSymbol.GetTypeMembers方法的具体用法?C# INamedTypeSymbol.GetTypeMembers怎么用?C# INamedTypeSymbol.GetTypeMembers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在INamedTypeSymbol的用法示例。


在下文中一共展示了INamedTypeSymbol.GetTypeMembers方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitNamedType

 public override void VisitNamedType(INamedTypeSymbol symbol)
 {
     foreach (var childSymbol in symbol.GetTypeMembers())
     {
         childSymbol.Accept(this);
     }
 }
开发者ID:yumapos,项目名称:Yumapos-WCF-Generator,代码行数:7,代码来源:VirtualizationVisitor.cs

示例2: VisitNamedType

        public override void VisitNamedType(INamedTypeSymbol symbol)
        {
            if (IsUnimportantSymbol(symbol))
                return;

            PrettyPrint(symbol);
            tabCount++;
            foreach (var childSymbol in symbol.GetTypeMembers())
            {
                childSymbol.Accept(this);
            }
            tabCount--;
        }
开发者ID:JoshVarty,项目名称:RoslynPad,代码行数:13,代码来源:NamedTypeVisitor.cs

示例3: VisitNamedType

        public override void VisitNamedType(INamedTypeSymbol symbol)
        {
            if (_finished || _symbolPredicate == null || _symbolPredicate(symbol))
            {
                MetadataItems metadata = new MetadataItems
                {
                    { CodeAnalysisKeys.SpecificKind, (k, m) => symbol.TypeKind.ToString() },
                    { CodeAnalysisKeys.ContainingType, DocumentFor(symbol.ContainingType) },
                    { CodeAnalysisKeys.MemberTypes, DocumentsFor(symbol.GetTypeMembers()) },
                    { CodeAnalysisKeys.BaseType, DocumentFor(symbol.BaseType) },
                    { CodeAnalysisKeys.AllInterfaces, DocumentsFor(symbol.AllInterfaces) },
                    { CodeAnalysisKeys.Members, DocumentsFor(symbol.GetMembers().Where(MemberPredicate)) },
                    { CodeAnalysisKeys.Constructors,
                        DocumentsFor(symbol.Constructors.Where(x => !x.IsImplicitlyDeclared)) },
                    { CodeAnalysisKeys.TypeParameters, DocumentsFor(symbol.TypeParameters) },
                    { CodeAnalysisKeys.Accessibility, (k, m) => symbol.DeclaredAccessibility.ToString() }
                };
                if (!_finished)
                {
                    metadata.AddRange(new []
                    {
                        new MetadataItem(CodeAnalysisKeys.DerivedTypes, (k, m) => GetDerivedTypes(symbol), true),
                        new MetadataItem(CodeAnalysisKeys.ImplementingTypes, (k, m) => GetImplementingTypes(symbol), true)
                    });
                }
                AddDocument(symbol, true, metadata);

                // Descend if not finished, and only if this type was included
                if (!_finished)
                {
                    Parallel.ForEach(symbol.GetMembers()
                        .Where(MemberPredicate)
                        .Concat(symbol.Constructors.Where(x => !x.IsImplicitlyDeclared)),
                        s => s.Accept(this));
                }
            }
        }
开发者ID:martinvobr,项目名称:Wyam,代码行数:37,代码来源:AnalyzeSymbolVisitor.cs

示例4: VisitNamedType

 public override void VisitNamedType(INamedTypeSymbol symbol)
 {
     base.VisitNamedType(symbol);
     foreach (var item in symbol.GetMembers())
     {
         item.Accept(this);
     }
     foreach (var item in symbol.GetTypeMembers())
     {
         item.Accept(this);
     }
 }
开发者ID:x335,项目名称:WootzJs,代码行数:12,代码来源:SymbolWalker.cs

示例5: LookupType

		static INamedTypeSymbol LookupType (string documentationCommentId, int reminder, INamedTypeSymbol current)
		{
			var idx = documentationCommentId.IndexOf ('.', reminder);
			var exact = idx < 0;
			var typeId = current.GetDocumentationCommentId ();
			if (exact) {
				if (typeId == documentationCommentId)
					return current;
				return null;
			}

			if (typeId.Length < reminder)
				return null;
			if (string.CompareOrdinal (documentationCommentId, reminder, typeId, reminder, idx - reminder - 1) == 0) {
				if (typeId.Length > idx)
					return null;
				foreach (var subType in current.GetTypeMembers ()) {
					var child = LookupType (documentationCommentId, idx  + 1, subType);
					if (child != null) {
						return child;
					}
				}
				return current;
				
			}
			return null;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:27,代码来源:CSharpFindReferencesProvider.cs

示例6: HasInstantiatedNestedType

        private bool HasInstantiatedNestedType(INamedTypeSymbol type, IEnumerable<INamedTypeSymbol> instantiatedTypes)
        {
            // We don't care whether a private nested type is instantiated, because if it
            // is, it can only have happened within the type itself.
            IEnumerable<INamedTypeSymbol> nestedTypes = type.GetTypeMembers()
                .Where(member => member.DeclaredAccessibility != Accessibility.Private);

            foreach (var nestedType in nestedTypes)
            {
                if (instantiatedTypes.Contains(nestedType))
                {
                    return true;
                }

                if (HasInstantiatedNestedType(nestedType, instantiatedTypes))
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:bkoelman,项目名称:roslyn-analyzers,代码行数:22,代码来源:AvoidUninstantiatedInternalClasses.cs

示例7: ScanType

        private static void ScanType(IList<Diagnostic> diagnostics, INamedTypeSymbol typeSymbol)
        {
            if (typeSymbol.Locations.Any(location => location.IsInSource))
            {
                RuleFieldPrivateKeyword(diagnostics, typeSymbol);
                RuleMembersAreInCorrectOrder(diagnostics, typeSymbol, MapClassMembers);
            }

            foreach (var member in typeSymbol.GetTypeMembers())
            {
                ScanType(diagnostics, member);
            }
        }
开发者ID:leloulight,项目名称:KestrelHttpServer,代码行数:13,代码来源:StandardsPoliceCompileModule.cs

示例8: ParseTheProjectType

        private void ParseTheProjectType(INamedTypeSymbol typeSymbol)
        {
            var sdNamespace = ParserOptions.SDRepository.GetNamespaceByIdentifier(typeSymbol.ContainingNamespace.GetIdentifier());
            var sdType = ParserOptions.SDRepository.GetTypeByIdentifier(typeSymbol.GetIdentifier());
            if (sdType == null)
            {
                sdType = CreateSDType(typeSymbol, sdNamespace);
                sdNamespace.Types.Add(sdType);
                ParserOptions.SDRepository.AddType(sdType);
            }
            else // already parsed as stranger
            {
                sdType.Namespace = ParserOptions.SDRepository.GetNamespaceByIdentifier(typeSymbol.ContainingNamespace.GetIdentifier());
                sdType.Regions = GetRegions(typeSymbol);
                sdType.IsProjectStranger = false;

                if(!sdNamespace.Types.Contains(sdType)) sdNamespace.Types.Add(sdType);
            }

            sdType.Documentations = DocumentationParser.ParseDocumentation(typeSymbol);
            AddParsedBaseType(sdType, typeSymbol.BaseType);
            AddParsedInterfaces(sdType, typeSymbol.Interfaces);
            AddParsedNestedTypes(sdType, typeSymbol.GetTypeMembers());

            _propertyParser.ParseProperties(sdType, typeSymbol);
            _fieldParser.ParseFields(sdType, typeSymbol);
            _methodParser.ParseConstructors(sdType, typeSymbol);
            _methodParser.ParseMethods(sdType, typeSymbol);
            _eventParser.ParseEvents(sdType, typeSymbol);

            sdType.TypeParameters = _typeParameterParser.ParseTypeParameters(typeSymbol.TypeParameters);
            foreach (var typeArgument in typeSymbol.TypeArguments)
            {
                sdType.TypeArguments.Add(_typeRefParser.GetParsedTypeReference(typeArgument));
            }
        }
开发者ID:Geaz,项目名称:sharpDox,代码行数:36,代码来源:TypeParser.cs


注:本文中的INamedTypeSymbol.GetTypeMembers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。