-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNamespaceReference.cs
More file actions
38 lines (32 loc) · 2.34 KB
/
Copy pathNamespaceReference.cs
File metadata and controls
38 lines (32 loc) · 2.34 KB
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
using System;
using System.Reflection;
namespace CodeMap.ReferenceData
{
/// <summary>Represents a namespace reference.</summary>
public class NamespaceReference : MemberReference
{
internal NamespaceReference(string name, AssemblyReference declaringAssembly)
=> (Name, Assembly) = (name, declaringAssembly);
/// <summary>The namespace name, or <see cref="string.Empty"/> for the global namespace.</summary>
public string Name { get; }
/// <summary>The declaring assembly.</summary>
public override AssemblyReference Assembly { get; }
/// <summary>Accepts the provided <paramref name="visitor"/> for selecting a concrete instance method.</summary>
/// <param name="visitor">The <see cref="MemberReferenceVisitor"/> interpreting the reference data.</param>
/// <exception cref="NullReferenceException">Thrown when <paramref name="visitor"/> is <c>null</c>.</exception>
public override void Accept(MemberReferenceVisitor visitor)
=> visitor.VisitNamespace(this);
/// <summary>Determines whether the current <see cref="NamespaceReference"/> is equal to the provided <paramref name="memberInfo"/>.</summary>
/// <param name="memberInfo">The <see cref="MemberInfo"/> to compare to.</param>
/// <returns>Returns <c>true</c> if the current <see cref="NamespaceReference"/> references the provided <paramref name="memberInfo"/>; <c>false</c> otherwise.</returns>
/// <remarks>This method always returns <c>false</c> because a <see cref="MemberInfo"/> cannot represent a namespace reference.</remarks>
public override bool Equals(MemberInfo memberInfo)
=> false;
/// <summary>Determines whether the current <see cref="NamespaceReference"/> is equal to the provided <paramref name="assemblyName"/>.</summary>
/// <param name="assemblyName">The <see cref="AssemblyName"/> to compare to.</param>
/// <returns>Returns <c>true</c> if the current <see cref="NamespaceReference"/> references the provided <paramref name="assemblyName"/>; <c>false</c> otherwise.</returns>
/// <remarks>This method always returns <c>false</c> because an <see cref="AssemblyName"/> cannot represent a namespace reference.</remarks>
public sealed override bool Equals(AssemblyName assemblyName)
=> false;
}
}