mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-14 11:40:42 +01:00
make api project portable
This commit is contained in:
19
MediaBrowser.Model/Diagnostics/IProcess.cs
Normal file
19
MediaBrowser.Model/Diagnostics/IProcess.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
27
MediaBrowser.Model/Diagnostics/IProcessFactory.cs
Normal file
27
MediaBrowser.Model/Diagnostics/IProcessFactory.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -305,6 +305,8 @@ namespace MediaBrowser.Model.IO
|
||||
char DirectorySeparatorChar { get; }
|
||||
|
||||
string GetFullPath(string path);
|
||||
|
||||
List<FileSystemMetadata> GetDrives();
|
||||
}
|
||||
|
||||
public enum FileOpenMode
|
||||
|
||||
@@ -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" />
|
||||
|
||||
10
MediaBrowser.Model/Threading/ITimer.cs
Normal file
10
MediaBrowser.Model/Threading/ITimer.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
10
MediaBrowser.Model/Threading/ITimerFactory.cs
Normal file
10
MediaBrowser.Model/Threading/ITimerFactory.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user