make api project portable

This commit is contained in:
Luke Pulverenti
2016-10-31 23:07:45 -04:00
parent b28857feea
commit 13d8110ce2
35 changed files with 326 additions and 255 deletions

View File

@@ -0,0 +1,19 @@
using System;
using System.IO;
namespace MediaBrowser.Model.Diagnostics
{
public interface IProcess : IDisposable
{
event EventHandler Exited;
void Kill();
bool WaitForExit(int timeMs);
int ExitCode { get; }
void Start();
StreamWriter StandardInput { get; }
StreamReader StandardError { get; }
StreamReader StandardOutput { get; }
ProcessOptions StartInfo { get; }
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MediaBrowser.Model.Diagnostics
{
public interface IProcessFactory
{
IProcess Create(ProcessOptions options);
}
public class ProcessOptions
{
public String FileName { get; set; }
public String Arguments { get; set; }
public String WorkingDirectory { get; set; }
public bool CreateNoWindow { get; set; }
public bool UseShellExecute { get; set; }
public bool EnableRaisingEvents { get; set; }
public bool ErrorDialog { get; set; }
public bool RedirectStandardError { get; set; }
public bool RedirectStandardInput { get; set; }
public bool IsHidden { get; set; }
}
}

View File

@@ -305,6 +305,8 @@ namespace MediaBrowser.Model.IO
char DirectorySeparatorChar { get; }
string GetFullPath(string path);
List<FileSystemMetadata> GetDrives();
}
public enum FileOpenMode

View File

@@ -106,6 +106,8 @@
<Compile Include="Devices\LocalFileInfo.cs" />
<Compile Include="Devices\DeviceInfo.cs" />
<Compile Include="Devices\DevicesOptions.cs" />
<Compile Include="Diagnostics\IProcess.cs" />
<Compile Include="Diagnostics\IProcessFactory.cs" />
<Compile Include="Dlna\CodecProfile.cs" />
<Compile Include="Dlna\ContainerProfile.cs" />
<Compile Include="Dlna\DeviceProfile.cs" />
@@ -422,6 +424,8 @@
<Compile Include="Tasks\ScheduledTaskHelpers.cs" />
<Compile Include="Tasks\TaskCompletionEventArgs.cs" />
<Compile Include="Tasks\TaskExecutionOptions.cs" />
<Compile Include="Threading\ITimer.cs" />
<Compile Include="Threading\ITimerFactory.cs" />
<Compile Include="Updates\CheckForUpdateResult.cs" />
<Compile Include="Updates\PackageTargetSystem.cs" />
<Compile Include="Updates\InstallationInfo.cs" />

View File

@@ -0,0 +1,10 @@
using System;
namespace MediaBrowser.Model.Threading
{
public interface ITimer : IDisposable
{
void Change(TimeSpan dueTime, TimeSpan period);
void Change(int dueTimeMs, int periodMs);
}
}

View File

@@ -0,0 +1,10 @@
using System;
namespace MediaBrowser.Model.Threading
{
public interface ITimerFactory
{
ITimer Create(Action<object> callback, object state, TimeSpan dueTime, TimeSpan period);
ITimer Create(Action<object> callback, object state, int dueTimeMs, int periodMs);
}
}