forked from ClearFoundry/ClearScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypeHelpers.NetCore.cs
More file actions
53 lines (43 loc) · 1.56 KB
/
Copy pathTypeHelpers.NetCore.cs
File metadata and controls
53 lines (43 loc) · 1.56 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Reflection;
using System.Runtime.InteropServices.ComTypes;
namespace Microsoft.ClearScript.Util
{
internal static partial class TypeHelpers
{
private static string GetFullTypeName(string name, string assemblyName, bool useAssemblyName, int typeArgCount)
{
var fullTypeName = name;
if (typeArgCount > 0)
{
fullTypeName += MiscHelpers.FormatInvariant("`{0}", typeArgCount);
}
if (useAssemblyName)
{
Assembly assembly;
if (MiscHelpers.Try(out assembly, () => Assembly.Load(AssemblyTable.GetFullAssemblyName(assemblyName))))
{
// ReSharper disable AccessToModifiedClosure
string result;
if (MiscHelpers.Try(out result, () => assembly.GetType(fullTypeName).AssemblyQualifiedName))
{
return result;
}
// ReSharper restore AccessToModifiedClosure
}
fullTypeName += MiscHelpers.FormatInvariant(", {0}", AssemblyTable.GetFullAssemblyName(assemblyName));
}
return fullTypeName;
}
public static IntPtr GetITypeInfo(this Type type)
{
return IntPtr.Zero;
}
public static Type GetManagedType(this ITypeInfo typeInfo)
{
return null;
}
}
}