mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-17 15:53:42 +01:00
moved some network code to the networking assembly
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Common.Extensions
|
||||
{
|
||||
@@ -45,23 +43,6 @@ namespace MediaBrowser.Common.Extensions
|
||||
return val.Split(new[] { separator }, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a non-blocking method to start a process and wait asynchronously for it to exit
|
||||
/// </summary>
|
||||
/// <param name="process">The process.</param>
|
||||
/// <returns>Task{System.Boolean}.</returns>
|
||||
public static Task<bool> RunAsync(this Process process)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
|
||||
process.EnableRaisingEvents = true;
|
||||
process.Exited += (sender, args) => tcs.SetResult(true);
|
||||
|
||||
process.Start();
|
||||
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuffles an IEnumerable
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user