-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use DecodeValue to check attribute values (#17605)
- Loading branch information
1 parent
f66cdff
commit 313186d
Showing
2 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ools/tasks/Microsoft.DotNet.SourceBuild.Tasks.LeakDetection/DummyAttributeTypeProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Reflection.Metadata; | ||
using System.Reflection.Metadata.Ecma335; | ||
|
||
namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection | ||
{ | ||
|
||
// An empty ICustomAttributeTypeProvider implementation is necessary to read metadata attribute values. | ||
internal class DummyAttributeTypeProvider : ICustomAttributeTypeProvider<Type> | ||
{ | ||
public static readonly DummyAttributeTypeProvider Instance = new(); | ||
|
||
public Type GetPrimitiveType(PrimitiveTypeCode typeCode) => default(Type); | ||
|
||
public Type GetSystemType() => default(Type); | ||
|
||
public Type GetSZArrayType(Type elementType) => default(Type); | ||
|
||
public Type GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => default(Type); | ||
|
||
public Type GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => default(Type); | ||
|
||
public Type GetTypeFromSerializedName(string name) => default(Type); | ||
|
||
public PrimitiveTypeCode GetUnderlyingEnumType(Type type) => default(PrimitiveTypeCode); | ||
|
||
public bool IsSystemType(Type type) => default(bool); | ||
} | ||
} |