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


C# IPropertySymbol.GetTypeArguments方法代码示例

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


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

示例1: GetTagsForProperty

        private IEnumerable<CompletionItem> GetTagsForProperty(IPropertySymbol symbol, TextSpan itemSpan, DocumentationCommentTriviaSyntax trivia, SyntaxToken token)
        {
            var items = new List<CompletionItem>();

            if (symbol.IsIndexer)
            {
                var parameters = symbol.GetParameters().Select(p => p.Name).ToSet();

                // User is trying to write a name, try to suggest only names.
                if (token.Parent.IsKind(SyntaxKind.XmlNameAttribute) ||
                    (token.Parent.IsKind(SyntaxKind.IdentifierName) && token.Parent.IsParentKind(SyntaxKind.XmlNameAttribute)))
                {
                    string parentElementName = null;

                    var emptyElement = token.GetAncestor<XmlEmptyElementSyntax>();
                    if (emptyElement != null)
                    {
                        parentElementName = emptyElement.Name.LocalName.Text;
                    }

                    // We're writing the name of a paramref
                    if (parentElementName == ParamRefTagName)
                    {
                        items.AddRange(parameters.Select(p => CreateCompletionItem(itemSpan, p)));
                    }

                    return items;
                }

                RemoveExistingTags(trivia, parameters, x => AttributeSelector(x, ParamTagName));
                items.AddRange(parameters.Select(p => CreateCompletionItem(itemSpan, FormatParameter(ParamTagName, p))));
            }

            var typeParameters = symbol.GetTypeArguments().Select(p => p.Name).ToSet();
            items.AddRange(typeParameters.Select(t => CreateCompletionItem(itemSpan, TypeParamTagName, NameAttributeName, t)));
            items.Add(CreateCompletionItem(itemSpan, "value"));
            return items;
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:38,代码来源:XmlDocCommentCompletionProvider.cs

示例2: GetTagsForProperty

        private IEnumerable<CompletionItem> GetTagsForProperty(IPropertySymbol symbol, TextSpan filterSpan, DocumentationCommentTriviaSyntax trivia)
        {
            var items = new List<CompletionItem>();

            var typeParameters = symbol.GetTypeArguments().Select(p => p.Name).ToSet();

            RemoveExistingTags(trivia, typeParameters, x => AttributeSelector(x, "typeparam"));

            items.AddRange(typeParameters.Select(t => new XmlItem(this, filterSpan, "typeparam", "name", t)));
            items.Add(new XmlItem(this, filterSpan, "value"));
            return items;
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:12,代码来源:XmlDocCommentCompletionProvider.cs

示例3: GetTagsForProperty

		private IEnumerable<CompletionData> GetTagsForProperty(CompletionEngine engine, IPropertySymbol symbol, TextSpan filterSpan, DocumentationCommentTriviaSyntax trivia)
		{
			var items = new List<CompletionData>();

			var typeParameters = symbol.GetTypeArguments().Select(p => p.Name).ToSet();

			RemoveExistingTags(trivia, typeParameters, x => AttributeSelector(x, "typeparam"));

			items.AddRange(typeParameters.Select(t => engine.Factory.CreateXmlDocCompletionData(this, "typeparam", null, "name$" + t)));
			items.Add(engine.Factory.CreateXmlDocCompletionData(this, "value"));
			return items;
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:12,代码来源:XmlDocCommentContextHandler.cs

示例4: GetTagsForProperty

        private IEnumerable<CompletionItem> GetTagsForProperty(IPropertySymbol symbol, DocumentationCommentTriviaSyntax trivia)
        {
            var items = new List<CompletionItem>();

            if (symbol.IsIndexer)
            {
                var parameters = symbol.GetParameters().Select(p => p.Name).ToSet();
                RemoveExistingTags(trivia, parameters, x => AttributeSelector(x, ParamTagName));
                items.AddRange(parameters.Select(p => CreateCompletionItem(FormatParameter(ParamTagName, p))));
            }

            var typeParameters = symbol.GetTypeArguments().Select(p => p.Name).ToSet();
            items.AddRange(typeParameters.Select(t => CreateCompletionItem(TypeParamTagName, NameAttributeName, t)));
            items.Add(CreateCompletionItem("value"));
            return items;
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:16,代码来源:XmlDocCommentCompletionProvider.cs


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