forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfileOptimizationShim.cs
More file actions
30 lines (27 loc) · 929 Bytes
/
ProfileOptimizationShim.cs
File metadata and controls
30 lines (27 loc) · 929 Bytes
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
using System;
using System.Reflection;
namespace ScriptCs
{
internal static class ProfileOptimizationShim
{
private static readonly Type profileOptimization = Type.GetType("System.Runtime.ProfileOptimization");
public static void SetProfileRoot(string directoryPath)
{
if (profileOptimization != null)
{
profileOptimization
.GetMethod("SetProfileRoot", BindingFlags.Public | BindingFlags.Static)
.Invoke(null, new object[] { directoryPath });
}
}
public static void StartProfile(string profile)
{
if (profileOptimization != null)
{
profileOptimization
.GetMethod("StartProfile", BindingFlags.Public | BindingFlags.Static)
.Invoke(null, new object[] { profile });
}
}
}
}