• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SymbolKind类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SymbolKind的典型用法代码示例。如果您正苦于以下问题:C# SymbolKind类的具体用法?C# SymbolKind怎么用?C# SymbolKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SymbolKind类属于命名空间,在下文中一共展示了SymbolKind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Symbol

 internal Symbol(SymbolKind kind, string name, string documentation, Symbol parent)
 {
     Kind = kind;
     Name = name;
     Documentation = documentation;
     Parent = parent;
 }
开发者ID:Samana,项目名称:HlslTools,代码行数:7,代码来源:Symbol.cs


示例2: InlineCodeToken

		public InlineCodeToken(TokenType type, string text = null, int index = -1, SymbolKind ownerType = default(SymbolKind), bool isExpandedParamArray = false) {
			Type   = type;
			_text  = text;
			_index = index;
			_ownerType = ownerType;
			_isExpandedParamArray = isExpandedParamArray;
		}
开发者ID:ShuntaoChen,项目名称:SaltarelleCompiler,代码行数:7,代码来源:InlineCodeToken.cs


示例3: SymbolInformation

 /// <summary>
 /// Creates a new symbol information literal.
 ///
 /// @param name The name of the symbol.
 /// @param kind The kind of the symbol.
 /// @param range The range of the location of the symbol.
 /// @param uri The resource of the location of symbol, defaults to the current document.
 /// @param containerName The name of the symbol containg the symbol.
 /// </summary>
 public SymbolInformation(string name, SymbolKind kind, Range range, string uri, string containerName)
 {
     this.name = name;
     this.kind = kind;
     this.location = new Location(uri, range);
     this.containerName = containerName;
 }
开发者ID:osmedile,项目名称:TypeCobol,代码行数:16,代码来源:SymbolInformation.cs


示例4: Symbol

 public Symbol(string symType, string symName,
     SymbolKind symKind, string declaringClassName)
 {
     Type = symType;
     Name = symName;
     Kind = symKind;
     DeclaringClassName = declaringClassName;
 }
开发者ID:selagroup,项目名称:diagnostics-courses,代码行数:8,代码来源:SymbolTable.cs


示例5: GetClass

        private string GetClass(SymbolKind kind)
        {
            if (kind == SymbolKind.TypeParameter)
            {
                return " t";
            }

            return "";
        }
开发者ID:rgmills,项目名称:SourceBrowser,代码行数:9,代码来源:DocumentGenerator.HighlightReferences.cs


示例6: Declaration

        public Declaration(Position position, string name, SymbolKind kind, AST.Type type)
            : base(position)
        {
            _name = name;

            _kind = kind;

            _type = type;
            _type.Parent = this;
        }
开发者ID:bencz,项目名称:Beryl,代码行数:10,代码来源:Declaration.cs


示例7: GetErrorReportingName

 public static object GetErrorReportingName(SymbolKind kind)
 {
     switch (kind)
     {
         case SymbolKind.Namespace:
             return MessageID.IDS_SK_NAMESPACE.Localize();
         default:
             // TODO: what is the right way to get these strings?
             return kind.ToString().ToLower();
     }
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:11,代码来源:ErrorFormatting.cs


示例8: SymbolMetadata

        public SymbolMetadata(
			string id, 
			string fullName, 
			string[] filePathsOfDeclarations, 
			SymbolKind symbolKind)
        {
            Id = id;
            FullName = fullName;
            DeclarationFilesPaths = filePathsOfDeclarations;
            SymbolKind = symbolKind;
        }
开发者ID:pgrefviau,项目名称:SourceMaster,代码行数:11,代码来源:SymbolMetadata.cs


示例9: Create

		/// <summary>
		/// Creates a type parameter reference.
		/// For common type parameter references, this method may return a shared instance.
		/// </summary>
		public static TypeParameterReference Create(SymbolKind ownerType, int index)
		{
			if (index >= 0 && index < 8 && (ownerType == SymbolKind.TypeDefinition || ownerType == SymbolKind.Method)) {
				TypeParameterReference[] arr = (ownerType == SymbolKind.TypeDefinition) ? classTypeParameterReferences : methodTypeParameterReferences;
				TypeParameterReference result = LazyInit.VolatileRead(ref arr[index]);
				if (result == null) {
					result = LazyInit.GetOrSet(ref arr[index], new TypeParameterReference(ownerType, index));
				}
				return result;
			} else {
				return new TypeParameterReference(ownerType, index);
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:17,代码来源:TypeParameterReference.cs


示例10: DefaultMemberReference

		public DefaultMemberReference(SymbolKind symbolKind, ITypeReference typeReference, string name, int typeParameterCount = 0, IList<ITypeReference> parameterTypes = null)
		{
			if (typeReference == null)
				throw new ArgumentNullException("typeReference");
			if (name == null)
				throw new ArgumentNullException("name");
			if (typeParameterCount != 0 && symbolKind != SymbolKind.Method)
				throw new ArgumentException("Type parameter count > 0 is only supported for methods.");
			this.symbolKind = symbolKind;
			this.typeReference = typeReference;
			this.name = name;
			this.typeParameterCount = typeParameterCount;
			this.parameterTypes = parameterTypes ?? EmptyList<ITypeReference>.Instance;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:14,代码来源:DefaultMemberReference.cs


示例11: InvocableSymbol

        internal InvocableSymbol(SymbolKind kind, string name, string documentation, Symbol parent, TypeSymbol returnType, Func<InvocableSymbol, IEnumerable<ParameterSymbol>> lazyParameters = null)
            : base(kind, name, documentation, parent)
        {
            if (returnType == null)
                throw new ArgumentNullException(nameof(returnType));

            _parameters = new List<ParameterSymbol>();

            if (lazyParameters != null)
                foreach (var parameter in lazyParameters(this))
                    AddParameter(parameter);

            ReturnType = returnType;
        }
开发者ID:Samana,项目名称:HlslTools,代码行数:14,代码来源:InvocableSymbol.cs


示例12: EnumerateSymbols

            private static IEnumerable<ValueTuple<ISymbol, int>> EnumerateSymbols(
                Compilation compilation, ISymbol containingSymbol,
                SymbolKind kind, string localName,
                CancellationToken cancellationToken)
            {
                int ordinal = 0;

                foreach (var declaringLocation in containingSymbol.DeclaringSyntaxReferences)
                {
                    // This operation can potentially fail. If containingSymbol came from 
                    // a SpeculativeSemanticModel, containingSymbol.ContainingAssembly.Compilation
                    // may not have been rebuilt to reflect the trees used by the 
                    // SpeculativeSemanticModel to produce containingSymbol. In that case,
                    // asking the ContainingAssembly's complation for a SemanticModel based
                    // on trees for containingSymbol with throw an ArgumentException.
                    // Unfortunately, the best way to avoid this (currently) is to see if
                    // we're asking for a model for a tree that's part of the compilation.
                    // (There's no way to get back to a SemanticModel from a symbol).

                    // TODO (rchande): It might be better to call compilation.GetSemanticModel
                    // and catch the ArgumentException. The compilation internally has a 
                    // Dictionary<SyntaxTree, ...> that it uses to check if the SyntaxTree
                    // is applicable wheras the public interface requires us to enumerate
                    // the entire IEnumerable of trees in the Compilation.
                    if (!compilation.SyntaxTrees.Contains(declaringLocation.SyntaxTree))
                    {
                        continue;
                    }

                    var node = declaringLocation.GetSyntax(cancellationToken);
                    if (node.Language == LanguageNames.VisualBasic)
                    {
                        node = node.Parent;
                    }

                    var semanticModel = compilation.GetSemanticModel(node.SyntaxTree);

                    foreach (var token in node.DescendantNodes())
                    {
                        var symbol = semanticModel.GetDeclaredSymbol(token, cancellationToken);

                        if (symbol != null &&
                            symbol.Kind == kind &&
                            SymbolKey.Equals(compilation, symbol.Name, localName))
                        {
                            yield return ValueTuple.Create(symbol, ordinal++);
                        }
                    }
                }
            }
开发者ID:jkotas,项目名称:roslyn,代码行数:50,代码来源:SymbolKey.BodyLevelSymbolKey.cs


示例13: DefaultTypeParameter

		public DefaultTypeParameter(
			ICompilation compilation, SymbolKind ownerType,
			int index, string name = null,
			VarianceModifier variance = VarianceModifier.Invariant,
			IList<IAttribute> attributes = null,
			DomRegion region = default(DomRegion),
			bool hasValueTypeConstraint = false, bool hasReferenceTypeConstraint = false, bool hasDefaultConstructorConstraint = false,
			IList<IType> constraints = null)
			: base(compilation, ownerType, index, name, variance, attributes, region)
		{
			this.hasValueTypeConstraint = hasValueTypeConstraint;
			this.hasReferenceTypeConstraint = hasReferenceTypeConstraint;
			this.hasDefaultConstructorConstraint = hasDefaultConstructorConstraint;
			this.constraints = constraints ?? EmptyList<IType>.Instance;
		}
开发者ID:sphynx79,项目名称:dotfiles,代码行数:15,代码来源:DefaultResolvedTypeParameter.cs


示例14: GetVimKind

		private string GetVimKind(SymbolKind entityType)
        {
    //        v	variable
    //f	function or method
    //m	member of a struct or class
            switch(entityType)
            {
			case(SymbolKind.Method):
                    return "f";
			case(SymbolKind.Field):
                    return "v";
			case(SymbolKind.Property):
                    return "m";
            }
            return " ";
        }
开发者ID:sphynx79,项目名称:dotfiles,代码行数:16,代码来源:MyCompletionCategory.cs


示例15: GetMemberType

        static string GetMemberType(SymbolKind symbolKind)
        {
            switch (symbolKind)
            {
                case SymbolKind.Field:
                    return GettextCatalog.GetString("field");
                case SymbolKind.Method:
                    return GettextCatalog.GetString("method");
                case SymbolKind.Property:
                    return GettextCatalog.GetString("property");
                case SymbolKind.Event:
                    return GettextCatalog.GetString("event");
            }

            return GettextCatalog.GetString("member");
        }
开发者ID:petterek,项目名称:RefactoringEssentials,代码行数:16,代码来源:LocalVariableHidesMemberAnalyzer.cs


示例16: AreEquivalentWorker

 private bool AreEquivalentWorker(ISymbol x, ISymbol y, SymbolKind k, Dictionary<INamedTypeSymbol, INamedTypeSymbol> equivalentTypesWithDifferingAssemblies)
 {
     Contract.Requires(x.Kind == y.Kind && x.Kind == k);
     switch (k)
     {
         case SymbolKind.ArrayType:
             return ArrayTypesAreEquivalent((IArrayTypeSymbol)x, (IArrayTypeSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.Assembly:
             return AssembliesAreEquivalent((IAssemblySymbol)x, (IAssemblySymbol)y);
         case SymbolKind.DynamicType:
             return DynamicTypesAreEquivalent((IDynamicTypeSymbol)x, (IDynamicTypeSymbol)y);
         case SymbolKind.Event:
             return EventsAreEquivalent((IEventSymbol)x, (IEventSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.Field:
             return FieldsAreEquivalent((IFieldSymbol)x, (IFieldSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.Label:
             return LabelsAreEquivalent((ILabelSymbol)x, (ILabelSymbol)y);
         case SymbolKind.Local:
             return LocalsAreEquivalent((ILocalSymbol)x, (ILocalSymbol)y);
         case SymbolKind.Method:
             return MethodsAreEquivalent((IMethodSymbol)x, (IMethodSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.NetModule:
             return ModulesAreEquivalent((IModuleSymbol)x, (IModuleSymbol)y);
         case SymbolKind.NamedType:
         case SymbolKind.ErrorType: // ErrorType is handled in NamedTypesAreEquivalent
             return NamedTypesAreEquivalent((INamedTypeSymbol)x, (INamedTypeSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.Namespace:
             return NamespacesAreEquivalent((INamespaceSymbol)x, (INamespaceSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.Parameter:
             return ParametersAreEquivalent((IParameterSymbol)x, (IParameterSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.PointerType:
             return PointerTypesAreEquivalent((IPointerTypeSymbol)x, (IPointerTypeSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.Property:
             return PropertiesAreEquivalent((IPropertySymbol)x, (IPropertySymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.RangeVariable:
             return RangeVariablesAreEquivalent((IRangeVariableSymbol)x, (IRangeVariableSymbol)y);
         case SymbolKind.TypeParameter:
             return TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies);
         case SymbolKind.Preprocessing:
             return PreprocessingSymbolsAreEquivalent((IPreprocessingSymbol)x, (IPreprocessingSymbol)y);
         default:
             return false;
     }
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:44,代码来源:SymbolEquivalenceComparer.EquivalenceVisitor.cs


示例17: SymbolKindToFieldKind

 internal static uint SymbolKindToFieldKind(SymbolKind kind) {
   uint ret = 0;
   if (kind == SymbolKind.All)
     ret = (uint ) FIELD_KIND.FIELD_KIND_ALL;
   else{
     if (0 != (kind & SymbolKind.Method))
       ret |= (uint ) (FIELD_KIND.FIELD_SYM_MEMBER|FIELD_KIND.FIELD_TYPE_METHOD);
     if (0 != (kind & SymbolKind.Property))
       ret |= (uint ) (FIELD_KIND.FIELD_SYM_MEMBER|FIELD_KIND.FIELD_TYPE_PROP);
     if (0 != (kind & SymbolKind.Field))
       ret |= (uint ) (FIELD_KIND.FIELD_KIND_ALL & ~(FIELD_KIND.FIELD_TYPE_METHOD|FIELD_KIND.FIELD_TYPE_PROP));
     if (0 != (kind & SymbolKind.This))
       ret |= (uint ) FIELD_KIND.FIELD_SYM_THIS;
     if (0 != (kind & SymbolKind.Local))
       ret |= (uint ) FIELD_KIND.FIELD_SYM_LOCAL;
     if (0 != (kind & SymbolKind.Parameter))
       ret |= (uint ) FIELD_KIND.FIELD_SYM_PARAM;
   }
   return ret;
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:20,代码来源:Symbol.cs


示例18: GetTypeParameter

		static ITypeParameter GetTypeParameter(ref ITypeParameter[] typeParameters, SymbolKind symbolKind, int index)
		{
			ITypeParameter[] tps = typeParameters;
			while (index >= tps.Length) {
				// We don't have a normal type parameter for this index, so we need to extend our array.
				// Because the array can be used concurrently from multiple threads, we have to use
				// Interlocked.CompareExchange.
				ITypeParameter[] newTps = new ITypeParameter[index + 1];
				tps.CopyTo(newTps, 0);
				for (int i = tps.Length; i < newTps.Length; i++) {
					newTps[i] = new DummyTypeParameter(symbolKind, i);
				}
				ITypeParameter[] oldTps = Interlocked.CompareExchange(ref typeParameters, newTps, tps);
				if (oldTps == tps) {
					// exchange successful
					tps = newTps;
				} else {
					// exchange not successful
					tps = oldTps;
				}
			}
			return tps[index];
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:23,代码来源:DummyTypeParameter.cs


示例19: GetDefaultAccessibility

        protected override Accessibility GetDefaultAccessibility(SymbolKind targetSymbolKind, CodeGenerationDestination destination)
        {
            switch (targetSymbolKind)
            {
                case SymbolKind.Field:
                case SymbolKind.Method:
                case SymbolKind.Property:
                case SymbolKind.Event:
                    return Accessibility.Private;

                case SymbolKind.NamedType:
                    switch (destination)
                    {
                        case CodeGenerationDestination.ClassType:
                        case CodeGenerationDestination.EnumType:
                        case CodeGenerationDestination.InterfaceType:
                        case CodeGenerationDestination.StructType:
                            return Accessibility.Private;
                        default:
                            return Accessibility.Internal;
                    }

                default:
                    Debug.Fail("Invalid symbol kind: " + targetSymbolKind);
                    throw Exceptions.ThrowEFail();
            }
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:27,代码来源:CSharpCodeModelService.cs


示例20: LocalVariableSymbol

        protected LocalVariableSymbol(SymbolKind kind, string name, string documentation, Symbol parent, TypeSymbol valueType)
            : base(kind, name, documentation, parent, valueType)
        {

        }
开发者ID:pminiszewski,项目名称:HlslTools,代码行数:5,代码来源:LocalVariableSymbol.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SymbolStyle类代码示例发布时间:2022-05-24
下一篇:
C# SymbolInfoOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap