forked from Inedo/bmx-windowslegacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShims.cs
More file actions
21 lines (19 loc) · 862 Bytes
/
Copy pathShims.cs
File metadata and controls
21 lines (19 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using System.Linq;
namespace Inedo.BuildMasterExtensions.Windows
{
/// <summary>
/// This should be removed in SDK v4.4 when CanPerformTask will officially be part of the SDK.
/// </summary>
internal static class Shims
{
public static bool CanPerformTask(int task, int? applicationGroupId = null, int? applicationId = null, int? environmentId = null, int? serverId = null)
{
var type = Type.GetType("Inedo.BuildMaster.Web.Security.WebUserContext,BuildMaster");
var canPerformTask = type
.GetMethods()
.First(m => m.Name == "CanPerformTask" && m.GetParameters().Length == 5);
return (bool)canPerformTask.Invoke(null, new object[] { task, applicationGroupId, applicationId, environmentId, serverId });
}
}
}