-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssemblyMetadata.cs
31 lines (26 loc) · 944 Bytes
/
AssemblyMetadata.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace BindingRedirectR
{
[Serializable]
internal class AssemblyMetadata
{
private readonly string[] _referenceAssemblyNames;
public string AssemblyName { get; }
public string Location { get; }
public IReadOnlyList<string> ReferenceAssemblyNames => _referenceAssemblyNames;
public AssemblyMetadata(Assembly assembly)
: this(assembly.FullName, assembly.Location, assembly.GetReferencedAssemblies().Select(x => x.FullName).ToArray())
{
}
public AssemblyMetadata(string assemblyName, string location, string[] referenceAssemblyNames)
{
AssemblyName = assemblyName;
Location = location;
_referenceAssemblyNames = referenceAssemblyNames;
}
public override string ToString() => AssemblyName;
}
}