Welcome to mirror list, hosted at ThFree Co, Russian Federation.

EcmaType.Diagnostic.cs « Ecma « TypeSystem « Common « tools « coreclr « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 028fec14c234000002d269e30c6ff1e37079a615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Threading;
using Debug = System.Diagnostics.Debug;

using Internal.NativeFormat;

namespace Internal.TypeSystem.Ecma
{
    /// <summary>
    /// Override of MetadataType that uses actual Ecma335 metadata.
    /// </summary>
    public sealed partial class EcmaType
    {
        public override string DiagnosticName
        {
            get
            {
                try
                {
                    return Name;
                }
                catch
                {
                    return $"TypeDef({MetadataReader.GetToken(Handle):x8})";
                }
            }
        }
        public override string DiagnosticNamespace
        {
            get
            {
                try
                {
                    return Namespace;
                }
                catch
                {
                    return ""; // If namespace throws, then Name will as well, and it will attach the token as the name instead.
                }
            }
        }
    }
}