moved some network code to the networking assembly

This commit is contained in:
LukePulverenti
2013-02-23 12:54:51 -05:00
parent 17c1fd5760
commit 465f0cc1e2
43 changed files with 505 additions and 179 deletions

View File

@@ -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>