< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 159
Coverable lines: 159
Total lines: 594
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 170
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/CodedIndex.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4namespace System.Reflection.Metadata.Ecma335
 5{
 6    public static class CodedIndex
 7    {
 8        /// <summary>
 9        /// Calculates a HasCustomAttribute coded index for the specified handle.
 10        /// </summary>
 11        /// <param name="handle">
 12        /// <see cref="MethodDefinitionHandle"/>,
 13        /// <see cref="FieldDefinitionHandle"/>,
 14        /// <see cref="TypeReferenceHandle"/>,
 15        /// <see cref="TypeDefinitionHandle"/>,
 16        /// <see cref="ParameterHandle"/>,
 17        /// <see cref="InterfaceImplementationHandle"/>,
 18        /// <see cref="MemberReferenceHandle"/>,
 19        /// <see cref="ModuleDefinitionHandle"/>,
 20        /// <see cref="DeclarativeSecurityAttributeHandle"/>,
 21        /// <see cref="PropertyDefinitionHandle"/>,
 22        /// <see cref="EventDefinitionHandle"/>,
 23        /// <see cref="StandaloneSignatureHandle"/>,
 24        /// <see cref="ModuleReferenceHandle"/>,
 25        /// <see cref="TypeSpecificationHandle"/>,
 26        /// <see cref="AssemblyDefinitionHandle"/>,
 27        /// <see cref="AssemblyReferenceHandle"/>,
 28        /// <see cref="AssemblyFileHandle"/>,
 29        /// <see cref="ExportedTypeHandle"/>,
 30        /// <see cref="ManifestResourceHandle"/>,
 31        /// <see cref="GenericParameterHandle"/>,
 32        /// <see cref="GenericParameterConstraintHandle"/> or
 33        /// <see cref="MethodSpecificationHandle"/>.
 34        /// </param>
 35        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 036        public static int HasCustomAttribute(EntityHandle handle) => (handle.RowId << (int)HasCustomAttributeTag.BitCoun
 37
 38        /// <summary>
 39        /// Calculates a HasConstant coded index for the specified handle.
 40        /// </summary>
 41        /// <param name="handle"><see cref="ParameterHandle"/>, <see cref="FieldDefinitionHandle"/>, or <see cref="Prope
 42        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 043        public static int HasConstant(EntityHandle handle) => (handle.RowId << (int)HasConstantTag.BitCount) | (int)ToHa
 44
 45        /// <summary>
 46        /// Calculates a CustomAttributeType coded index for the specified handle.
 47        /// </summary>
 48        /// <param name="handle"><see cref="MethodDefinitionHandle"/> or <see cref="MemberReferenceHandle"/></param>
 49        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 050        public static int CustomAttributeType(EntityHandle handle) => (handle.RowId << (int)CustomAttributeTypeTag.BitCo
 51
 52        /// <summary>
 53        /// Calculates a HasDeclSecurity coded index for the specified handle.
 54        /// </summary>
 55        /// <param name="handle"><see cref="TypeDefinitionHandle"/>, <see cref="MethodDefinitionHandle"/>, or <see cref=
 56        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 057        public static int HasDeclSecurity(EntityHandle handle) => (handle.RowId << (int)HasDeclSecurityTag.BitCount) | (
 58
 59        /// <summary>
 60        /// Calculates a HasFieldMarshal coded index for the specified handle.
 61        /// </summary>
 62        /// <param name="handle"><see cref = "ParameterHandle" /> or <see cref="FieldDefinitionHandle"/></param>
 63        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 064        public static int HasFieldMarshal(EntityHandle handle) => (handle.RowId << (int)HasFieldMarshalTag.BitCount) | (
 65
 66        /// <summary>
 67        /// Calculates a HasSemantics coded index for the specified handle.
 68        /// </summary>
 69        /// <param name="handle"><see cref="EventDefinitionHandle"/> or <see cref="PropertyDefinitionHandle"/></param>
 70        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 071        public static int HasSemantics(EntityHandle handle) => (handle.RowId << (int)HasSemanticsTag.BitCount) | (int)To
 72
 73        /// <summary>
 74        /// Calculates a Implementation coded index for the specified handle.
 75        /// </summary>
 76        /// <param name="handle"><see cref="AssemblyFileHandle"/>, <see cref="ExportedTypeHandle"/> or <see cref="Assemb
 77        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 078        public static int Implementation(EntityHandle handle) => (handle.RowId << (int)ImplementationTag.BitCount) | (in
 79
 80        /// <summary>
 81        /// Calculates a MemberForwarded coded index for the specified handle.
 82        /// </summary>
 83        /// <param name="handle"><see cref="FieldDefinition"/>, <see cref="MethodDefinition"/></param>
 84        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 085        public static int MemberForwarded(EntityHandle handle) => (handle.RowId << (int)MemberForwardedTag.BitCount) | (
 86
 87        /// <summary>
 88        /// Calculates a MemberRefParent coded index for the specified handle.
 89        /// </summary>
 90        /// <param name="handle">
 91        /// <see cref="TypeDefinitionHandle"/>,
 92        /// <see cref="TypeReferenceHandle"/>,
 93        /// <see cref="ModuleReferenceHandle"/>,
 94        /// <see cref="MethodDefinitionHandle"/>, or
 95        /// <see cref="TypeSpecificationHandle"/>.
 96        /// </param>
 97        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 098        public static int MemberRefParent(EntityHandle handle) => (handle.RowId << (int)MemberRefParentTag.BitCount) | (
 99
 100        /// <summary>
 101        /// Calculates a MethodDefOrRef coded index for the specified handle.
 102        /// </summary>
 103        /// <param name="handle"><see cref="MethodDefinitionHandle"/> or <see cref="MemberReferenceHandle"/></param>
 104        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 0105        public static int MethodDefOrRef(EntityHandle handle) => (handle.RowId << (int)MethodDefOrRefTag.BitCount) | (in
 106
 107        /// <summary>
 108        /// Calculates a ResolutionScope coded index for the specified handle.
 109        /// </summary>
 110        /// <param name="handle"><see cref="ModuleDefinitionHandle"/>, <see cref="ModuleReferenceHandle"/>, <see cref="A
 111        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 0112        public static int ResolutionScope(EntityHandle handle) => (handle.RowId << (int)ResolutionScopeTag.BitCount) | (
 113
 114        /// <summary>
 115        /// Calculates a TypeDefOrRef coded index for the specified handle.
 116        /// </summary>
 117        /// <param name="handle"><see cref="TypeDefinitionHandle"/> or <see cref="TypeReferenceHandle"/></param>
 118        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 0119        public static int TypeDefOrRef(EntityHandle handle) => (handle.RowId << (int)TypeDefOrRefTag.BitCount) | (int)To
 120
 121        /// <summary>
 122        /// Calculates a TypeDefOrRefOrSpec coded index for the specified handle.
 123        /// </summary>
 124        /// <param name="handle"><see cref="TypeDefinitionHandle"/>, <see cref="TypeReferenceHandle"/> or <see cref="Typ
 125        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 0126        public static int TypeDefOrRefOrSpec(EntityHandle handle) => (handle.RowId << (int)TypeDefOrRefOrSpecTag.BitCoun
 127
 128        /// <summary>
 129        /// Calculates a TypeOrMethodDef coded index for the specified handle.
 130        /// </summary>
 131        /// <param name="handle"><see cref="TypeDefinitionHandle"/> or <see cref="MethodDefinitionHandle"/></param>
 132        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 0133        public static int TypeOrMethodDef(EntityHandle handle) => (handle.RowId << (int)TypeOrMethodDefTag.BitCount) | (
 134
 135        /// <summary>
 136        /// Calculates a HasCustomDebugInformation coded index for the specified handle.
 137        /// </summary>
 138        /// <param name="handle">
 139        /// <see cref="MethodDefinitionHandle"/>,
 140        /// <see cref="FieldDefinitionHandle"/>,
 141        /// <see cref="TypeReferenceHandle"/>,
 142        /// <see cref="TypeDefinitionHandle"/>,
 143        /// <see cref="ParameterHandle"/>,
 144        /// <see cref="InterfaceImplementationHandle"/>,
 145        /// <see cref="MemberReferenceHandle"/>,
 146        /// <see cref="ModuleDefinitionHandle"/>,
 147        /// <see cref="DeclarativeSecurityAttributeHandle"/>,
 148        /// <see cref="PropertyDefinitionHandle"/>,
 149        /// <see cref="EventDefinitionHandle"/>,
 150        /// <see cref="StandaloneSignatureHandle"/>,
 151        /// <see cref="ModuleReferenceHandle"/>,
 152        /// <see cref="TypeSpecificationHandle"/>,
 153        /// <see cref="AssemblyDefinitionHandle"/>,
 154        /// <see cref="AssemblyReferenceHandle"/>,
 155        /// <see cref="AssemblyFileHandle"/>,
 156        /// <see cref="ExportedTypeHandle"/>,
 157        /// <see cref="ManifestResourceHandle"/>,
 158        /// <see cref="GenericParameterHandle"/>,
 159        /// <see cref="GenericParameterConstraintHandle"/>,
 160        /// <see cref="MethodSpecificationHandle"/>,
 161        /// <see cref="DocumentHandle"/>,
 162        /// <see cref="LocalScopeHandle"/>,
 163        /// <see cref="LocalVariableHandle"/>,
 164        /// <see cref="LocalConstantHandle"/> or
 165        /// <see cref="ImportScopeHandle"/>.
 166        /// </param>
 167        /// <exception cref="ArgumentException">Unexpected handle kind.</exception>
 0168        public static int HasCustomDebugInformation(EntityHandle handle) => (handle.RowId << (int)HasCustomDebugInformat
 169
 170        private enum HasCustomAttributeTag
 171        {
 172            MethodDef = 0,
 173            Field = 1,
 174            TypeRef = 2,
 175            TypeDef = 3,
 176            Param = 4,
 177            InterfaceImpl = 5,
 178            MemberRef = 6,
 179            Module = 7,
 180            DeclSecurity = 8,
 181            Property = 9,
 182            Event = 10,
 183            StandAloneSig = 11,
 184            ModuleRef = 12,
 185            TypeSpec = 13,
 186            Assembly = 14,
 187            AssemblyRef = 15,
 188            File = 16,
 189            ExportedType = 17,
 190            ManifestResource = 18,
 191            GenericParam = 19,
 192            GenericParamConstraint = 20,
 193            MethodSpec = 21,
 194
 195            BitCount = 5
 196        }
 197
 198        private static HasCustomAttributeTag ToHasCustomAttributeTag(HandleKind kind)
 0199        {
 0200            switch (kind)
 201            {
 0202                case HandleKind.MethodDefinition: return HasCustomAttributeTag.MethodDef;
 0203                case HandleKind.FieldDefinition: return HasCustomAttributeTag.Field;
 0204                case HandleKind.TypeReference: return HasCustomAttributeTag.TypeRef;
 0205                case HandleKind.TypeDefinition: return HasCustomAttributeTag.TypeDef;
 0206                case HandleKind.Parameter: return HasCustomAttributeTag.Param;
 0207                case HandleKind.InterfaceImplementation: return HasCustomAttributeTag.InterfaceImpl;
 0208                case HandleKind.MemberReference: return HasCustomAttributeTag.MemberRef;
 0209                case HandleKind.ModuleDefinition: return HasCustomAttributeTag.Module;
 0210                case HandleKind.DeclarativeSecurityAttribute: return HasCustomAttributeTag.DeclSecurity;
 0211                case HandleKind.PropertyDefinition: return HasCustomAttributeTag.Property;
 0212                case HandleKind.EventDefinition: return HasCustomAttributeTag.Event;
 0213                case HandleKind.StandaloneSignature: return HasCustomAttributeTag.StandAloneSig;
 0214                case HandleKind.ModuleReference: return HasCustomAttributeTag.ModuleRef;
 0215                case HandleKind.TypeSpecification: return HasCustomAttributeTag.TypeSpec;
 0216                case HandleKind.AssemblyDefinition: return HasCustomAttributeTag.Assembly;
 0217                case HandleKind.AssemblyReference: return HasCustomAttributeTag.AssemblyRef;
 0218                case HandleKind.AssemblyFile: return HasCustomAttributeTag.File;
 0219                case HandleKind.ExportedType: return HasCustomAttributeTag.ExportedType;
 0220                case HandleKind.ManifestResource: return HasCustomAttributeTag.ManifestResource;
 0221                case HandleKind.GenericParameter: return HasCustomAttributeTag.GenericParam;
 0222                case HandleKind.GenericParameterConstraint: return HasCustomAttributeTag.GenericParamConstraint;
 0223                case HandleKind.MethodSpecification: return HasCustomAttributeTag.MethodSpec;
 224
 225                default:
 0226                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 227                    return 0;
 228            }
 0229        }
 230
 231        private enum HasConstantTag
 232        {
 233            Field = 0,
 234            Param = 1,
 235            Property = 2,
 236
 237            BitCount = 2
 238        }
 239
 240        private static HasConstantTag ToHasConstantTag(HandleKind kind)
 0241        {
 0242            switch (kind)
 243            {
 0244                case HandleKind.FieldDefinition: return HasConstantTag.Field;
 0245                case HandleKind.Parameter: return HasConstantTag.Param;
 0246                case HandleKind.PropertyDefinition: return HasConstantTag.Property;
 247
 248                default:
 0249                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 250                    return 0;
 251            }
 0252        }
 253
 254        private enum CustomAttributeTypeTag
 255        {
 256            MethodDef = 2,
 257            MemberRef = 3,
 258
 259            BitCount = 3
 260        }
 261
 262        private static CustomAttributeTypeTag ToCustomAttributeTypeTag(HandleKind kind)
 0263        {
 0264            switch (kind)
 265            {
 0266                case HandleKind.MethodDefinition: return CustomAttributeTypeTag.MethodDef;
 0267                case HandleKind.MemberReference: return CustomAttributeTypeTag.MemberRef;
 268
 269                default:
 0270                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 271                    return 0;
 272            }
 0273        }
 274
 275        private enum HasDeclSecurityTag
 276        {
 277            TypeDef = 0,
 278            MethodDef = 1,
 279            Assembly = 2,
 280
 281            BitCount = 2
 282        }
 283
 284        private static HasDeclSecurityTag ToHasDeclSecurityTag(HandleKind kind)
 0285        {
 0286            switch (kind)
 287            {
 0288                case HandleKind.TypeDefinition: return HasDeclSecurityTag.TypeDef;
 0289                case HandleKind.MethodDefinition: return HasDeclSecurityTag.MethodDef;
 0290                case HandleKind.AssemblyDefinition: return HasDeclSecurityTag.Assembly;
 291
 292                default:
 0293                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 294                    return 0;
 295            }
 0296        }
 297
 298        private enum HasFieldMarshalTag
 299        {
 300            Field = 0,
 301            Param = 1,
 302
 303            BitCount = 1
 304        }
 305
 306        private static HasFieldMarshalTag ToHasFieldMarshalTag(HandleKind kind)
 0307        {
 0308            switch (kind)
 309            {
 0310                case HandleKind.FieldDefinition: return HasFieldMarshalTag.Field;
 0311                case HandleKind.Parameter: return HasFieldMarshalTag.Param;
 312
 313                default:
 0314                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 315                    return 0;
 316            }
 0317        }
 318
 319        private enum HasSemanticsTag
 320        {
 321            Event = 0,
 322            Property = 1,
 323
 324            BitCount = 1
 325        }
 326
 327        private static HasSemanticsTag ToHasSemanticsTag(HandleKind kind)
 0328        {
 0329            switch (kind)
 330            {
 0331                case HandleKind.EventDefinition: return HasSemanticsTag.Event;
 0332                case HandleKind.PropertyDefinition: return HasSemanticsTag.Property;
 333
 334                default:
 0335                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 336                    return 0;
 337            }
 0338        }
 339
 340        private enum ImplementationTag
 341        {
 342            File = 0,
 343            AssemblyRef = 1,
 344            ExportedType = 2,
 345
 346            BitCount = 2
 347        }
 348
 349        private static ImplementationTag ToImplementationTag(HandleKind kind)
 0350        {
 0351            switch (kind)
 352            {
 0353                case HandleKind.AssemblyFile: return ImplementationTag.File;
 0354                case HandleKind.AssemblyReference: return ImplementationTag.AssemblyRef;
 0355                case HandleKind.ExportedType: return ImplementationTag.ExportedType;
 356
 357                default:
 0358                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 359                    return 0;
 360            }
 0361        }
 362
 363        private enum MemberForwardedTag
 364        {
 365            Field = 0,
 366            MethodDef = 1,
 367
 368            BitCount = 1
 369        }
 370
 371        private static MemberForwardedTag ToMemberForwardedTag(HandleKind kind)
 0372        {
 0373            switch (kind)
 374            {
 0375                case HandleKind.FieldDefinition: return MemberForwardedTag.Field;
 0376                case HandleKind.MethodDefinition: return MemberForwardedTag.MethodDef;
 377
 378                default:
 0379                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 380                    return 0;
 381            }
 0382        }
 383
 384        private enum MemberRefParentTag
 385        {
 386            TypeDef = 0,
 387            TypeRef = 1,
 388            ModuleRef = 2,
 389            MethodDef = 3,
 390            TypeSpec = 4,
 391
 392            BitCount = 3
 393        }
 394
 395        private static MemberRefParentTag ToMemberRefParentTag(HandleKind kind)
 0396        {
 0397            switch (kind)
 398            {
 0399                case HandleKind.TypeDefinition: return MemberRefParentTag.TypeDef;
 0400                case HandleKind.TypeReference: return MemberRefParentTag.TypeRef;
 0401                case HandleKind.ModuleReference: return MemberRefParentTag.ModuleRef;
 0402                case HandleKind.MethodDefinition: return MemberRefParentTag.MethodDef;
 0403                case HandleKind.TypeSpecification: return MemberRefParentTag.TypeSpec;
 404
 405                default:
 0406                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 407                    return 0;
 408            }
 0409        }
 410
 411        private enum MethodDefOrRefTag
 412        {
 413            MethodDef = 0,
 414            MemberRef = 1,
 415
 416            BitCount = 1
 417        }
 418
 419        private static MethodDefOrRefTag ToMethodDefOrRefTag(HandleKind kind)
 0420        {
 0421            switch (kind)
 422            {
 0423                case HandleKind.MethodDefinition: return MethodDefOrRefTag.MethodDef;
 0424                case HandleKind.MemberReference: return MethodDefOrRefTag.MemberRef;
 425
 426                default:
 0427                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 428                    return 0;
 429            }
 0430        }
 431
 432        private enum ResolutionScopeTag
 433        {
 434            Module = 0,
 435            ModuleRef = 1,
 436            AssemblyRef = 2,
 437            TypeRef = 3,
 438
 439            BitCount = 2
 440        }
 441
 442        private static ResolutionScopeTag ToResolutionScopeTag(HandleKind kind)
 0443        {
 0444            switch (kind)
 445            {
 0446                case HandleKind.ModuleDefinition: return ResolutionScopeTag.Module;
 0447                case HandleKind.ModuleReference: return ResolutionScopeTag.ModuleRef;
 0448                case HandleKind.AssemblyReference: return ResolutionScopeTag.AssemblyRef;
 0449                case HandleKind.TypeReference: return ResolutionScopeTag.TypeRef;
 450
 451                default:
 0452                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 453                    return 0;
 454            }
 0455        }
 456
 457        private enum TypeDefOrRefOrSpecTag
 458        {
 459            TypeDef = 0,
 460            TypeRef = 1,
 461            TypeSpec = 2,
 462
 463            BitCount = 2
 464        }
 465
 466        private static TypeDefOrRefOrSpecTag ToTypeDefOrRefOrSpecTag(HandleKind kind)
 0467        {
 0468            switch (kind)
 469            {
 0470                case HandleKind.TypeDefinition: return TypeDefOrRefOrSpecTag.TypeDef;
 0471                case HandleKind.TypeReference: return TypeDefOrRefOrSpecTag.TypeRef;
 0472                case HandleKind.TypeSpecification: return TypeDefOrRefOrSpecTag.TypeSpec;
 473
 474                default:
 0475                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 476                    return 0;
 477            }
 0478        }
 479
 480        private enum TypeDefOrRefTag
 481        {
 482            TypeDef = 0,
 483            TypeRef = 1,
 484
 485            BitCount = 2
 486        }
 487
 488        private static TypeDefOrRefTag ToTypeDefOrRefTag(HandleKind kind)
 0489        {
 0490            switch (kind)
 491            {
 0492                case HandleKind.TypeDefinition: return TypeDefOrRefTag.TypeDef;
 0493                case HandleKind.TypeReference: return TypeDefOrRefTag.TypeRef;
 494
 495                default:
 0496                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 497                    return 0;
 498            }
 0499        }
 500
 501        private enum TypeOrMethodDefTag
 502        {
 503            TypeDef = 0,
 504            MethodDef = 1,
 505
 506            BitCount = 1
 507        }
 508
 509        private static TypeOrMethodDefTag ToTypeOrMethodDefTag(HandleKind kind)
 0510        {
 0511            switch (kind)
 512            {
 0513                case HandleKind.TypeDefinition: return TypeOrMethodDefTag.TypeDef;
 0514                case HandleKind.MethodDefinition: return TypeOrMethodDefTag.MethodDef;
 515
 516                default:
 0517                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 518                    return 0;
 519            }
 0520        }
 521
 522        private enum HasCustomDebugInformationTag
 523        {
 524            MethodDef = 0,
 525            Field = 1,
 526            TypeRef = 2,
 527            TypeDef = 3,
 528            Param = 4,
 529            InterfaceImpl = 5,
 530            MemberRef = 6,
 531            Module = 7,
 532            DeclSecurity = 8,
 533            Property = 9,
 534            Event = 10,
 535            StandAloneSig = 11,
 536            ModuleRef = 12,
 537            TypeSpec = 13,
 538            Assembly = 14,
 539            AssemblyRef = 15,
 540            File = 16,
 541            ExportedType = 17,
 542            ManifestResource = 18,
 543            GenericParam = 19,
 544            GenericParamConstraint = 20,
 545            MethodSpec = 21,
 546            Document = 22,
 547            LocalScope = 23,
 548            LocalVariable = 24,
 549            LocalConstant = 25,
 550            ImportScope = 26,
 551
 552            BitCount = 5
 553        }
 554
 555        private static HasCustomDebugInformationTag ToHasCustomDebugInformationTag(HandleKind kind)
 0556        {
 0557            switch (kind)
 558            {
 0559                case HandleKind.MethodDefinition: return HasCustomDebugInformationTag.MethodDef;
 0560                case HandleKind.FieldDefinition: return HasCustomDebugInformationTag.Field;
 0561                case HandleKind.TypeReference: return HasCustomDebugInformationTag.TypeRef;
 0562                case HandleKind.TypeDefinition: return HasCustomDebugInformationTag.TypeDef;
 0563                case HandleKind.Parameter: return HasCustomDebugInformationTag.Param;
 0564                case HandleKind.InterfaceImplementation: return HasCustomDebugInformationTag.InterfaceImpl;
 0565                case HandleKind.MemberReference: return HasCustomDebugInformationTag.MemberRef;
 0566                case HandleKind.ModuleDefinition: return HasCustomDebugInformationTag.Module;
 0567                case HandleKind.DeclarativeSecurityAttribute: return HasCustomDebugInformationTag.DeclSecurity;
 0568                case HandleKind.PropertyDefinition: return HasCustomDebugInformationTag.Property;
 0569                case HandleKind.EventDefinition: return HasCustomDebugInformationTag.Event;
 0570                case HandleKind.StandaloneSignature: return HasCustomDebugInformationTag.StandAloneSig;
 0571                case HandleKind.ModuleReference: return HasCustomDebugInformationTag.ModuleRef;
 0572                case HandleKind.TypeSpecification: return HasCustomDebugInformationTag.TypeSpec;
 0573                case HandleKind.AssemblyDefinition: return HasCustomDebugInformationTag.Assembly;
 0574                case HandleKind.AssemblyReference: return HasCustomDebugInformationTag.AssemblyRef;
 0575                case HandleKind.AssemblyFile: return HasCustomDebugInformationTag.File;
 0576                case HandleKind.ExportedType: return HasCustomDebugInformationTag.ExportedType;
 0577                case HandleKind.ManifestResource: return HasCustomDebugInformationTag.ManifestResource;
 0578                case HandleKind.GenericParameter: return HasCustomDebugInformationTag.GenericParam;
 0579                case HandleKind.GenericParameterConstraint: return HasCustomDebugInformationTag.GenericParamConstraint;
 0580                case HandleKind.MethodSpecification: return HasCustomDebugInformationTag.MethodSpec;
 0581                case HandleKind.Document: return HasCustomDebugInformationTag.Document;
 0582                case HandleKind.LocalScope: return HasCustomDebugInformationTag.LocalScope;
 0583                case HandleKind.LocalVariable: return HasCustomDebugInformationTag.LocalVariable;
 0584                case HandleKind.LocalConstant: return HasCustomDebugInformationTag.LocalConstant;
 0585                case HandleKind.ImportScope: return HasCustomDebugInformationTag.ImportScope;
 586
 587                default:
 0588                    Throw.InvalidArgument_UnexpectedHandleKind(kind);
 589                    return 0;
 590            }
 0591        }
 592    }
 593}
 594

Methods/Properties

HasCustomAttribute(System.Reflection.Metadata.EntityHandle)
HasConstant(System.Reflection.Metadata.EntityHandle)
CustomAttributeType(System.Reflection.Metadata.EntityHandle)
HasDeclSecurity(System.Reflection.Metadata.EntityHandle)
HasFieldMarshal(System.Reflection.Metadata.EntityHandle)
HasSemantics(System.Reflection.Metadata.EntityHandle)
Implementation(System.Reflection.Metadata.EntityHandle)
MemberForwarded(System.Reflection.Metadata.EntityHandle)
MemberRefParent(System.Reflection.Metadata.EntityHandle)
MethodDefOrRef(System.Reflection.Metadata.EntityHandle)
ResolutionScope(System.Reflection.Metadata.EntityHandle)
TypeDefOrRef(System.Reflection.Metadata.EntityHandle)
TypeDefOrRefOrSpec(System.Reflection.Metadata.EntityHandle)
TypeOrMethodDef(System.Reflection.Metadata.EntityHandle)
HasCustomDebugInformation(System.Reflection.Metadata.EntityHandle)
ToHasCustomAttributeTag(System.Reflection.Metadata.HandleKind)
ToHasConstantTag(System.Reflection.Metadata.HandleKind)
ToCustomAttributeTypeTag(System.Reflection.Metadata.HandleKind)
ToHasDeclSecurityTag(System.Reflection.Metadata.HandleKind)
ToHasFieldMarshalTag(System.Reflection.Metadata.HandleKind)
ToHasSemanticsTag(System.Reflection.Metadata.HandleKind)
ToImplementationTag(System.Reflection.Metadata.HandleKind)
ToMemberForwardedTag(System.Reflection.Metadata.HandleKind)
ToMemberRefParentTag(System.Reflection.Metadata.HandleKind)
ToMethodDefOrRefTag(System.Reflection.Metadata.HandleKind)
ToResolutionScopeTag(System.Reflection.Metadata.HandleKind)
ToTypeDefOrRefOrSpecTag(System.Reflection.Metadata.HandleKind)
ToTypeDefOrRefTag(System.Reflection.Metadata.HandleKind)
ToTypeOrMethodDefTag(System.Reflection.Metadata.HandleKind)
ToHasCustomDebugInformationTag(System.Reflection.Metadata.HandleKind)