mirror of https://github.com/dahall/Vanara.git
Added throttling app support
parent
b393d908a3
commit
88b92e2cb8
|
@ -2,14 +2,26 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Threading;
|
||||||
using Vanara.InteropServices;
|
using Vanara.InteropServices;
|
||||||
|
|
||||||
namespace Vanara.PInvoke.Tests
|
namespace Vanara.PInvoke.Tests
|
||||||
{
|
{
|
||||||
public static class TestHelper
|
public static class TestHelper
|
||||||
{
|
{
|
||||||
|
private const string testApp = @"C:\Users\dahall\Documents\Visual Studio 2017\Projects\TestSysConsumption\bin\Debug\netcoreapp3.0\TestSysConsumption.exe";
|
||||||
|
|
||||||
|
public static Process RunThrottleApp() => Process.Start(testApp);
|
||||||
|
|
||||||
|
public static void SetThrottle(string type, bool on)
|
||||||
|
{
|
||||||
|
using (var evt = new EventWaitHandle(false, EventResetMode.AutoReset, (on ? "" : "End") + type))
|
||||||
|
evt.Set();
|
||||||
|
}
|
||||||
|
|
||||||
public static IList<string> GetNestedStructSizes(this Type type, params string[] filters)
|
public static IList<string> GetNestedStructSizes(this Type type, params string[] filters)
|
||||||
{
|
{
|
||||||
var output = new List<string>();
|
var output = new List<string>();
|
||||||
|
|
Loading…
Reference in New Issue