jellyfin/MediaBrowser.Common/IApplicationHost.cs

162 lines
5 KiB
C#
Raw Normal View History

2014-05-08 22:09:53 +02:00
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Updates;
2013-02-22 05:23:06 +01:00
using System;
2013-02-24 22:53:54 +01:00
using System.Collections.Generic;
2013-02-22 05:23:06 +01:00
using System.Threading;
using System.Threading.Tasks;
2013-03-04 06:43:06 +01:00
namespace MediaBrowser.Common
{
/// <summary>
/// An interface to be implemented by the applications hosting a kernel
/// </summary>
public interface IApplicationHost
{
2014-11-24 00:10:41 +01:00
/// <summary>
/// Gets the display name of the operating system.
/// </summary>
/// <value>The display name of the operating system.</value>
string OperatingSystemDisplayName { get; }
2014-01-25 22:07:19 +01:00
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
string Name { get; }
2014-09-06 19:46:09 +02:00
/// <summary>
/// Gets the device identifier.
/// </summary>
/// <value>The device identifier.</value>
string SystemId { get; }
2013-03-11 20:36:32 +01:00
/// <summary>
/// Occurs when [application updated].
/// </summary>
2014-04-30 17:07:02 +02:00
event EventHandler<GenericEventArgs<PackageVersionInfo>> ApplicationUpdated;
2013-03-11 20:36:32 +01:00
2013-03-07 06:34:00 +01:00
/// <summary>
/// Gets or sets a value indicating whether this instance has pending kernel reload.
/// </summary>
/// <value><c>true</c> if this instance has pending kernel reload; otherwise, <c>false</c>.</value>
bool HasPendingRestart { get; }
2013-10-07 16:38:31 +02:00
/// <summary>
/// Gets a value indicating whether this instance can self restart.
/// </summary>
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
bool CanSelfRestart { get; }
2013-03-07 06:34:00 +01:00
/// <summary>
/// Occurs when [has pending restart changed].
/// </summary>
event EventHandler HasPendingRestartChanged;
/// <summary>
/// Notifies the pending restart.
/// </summary>
void NotifyPendingRestart();
/// <summary>
/// Restarts this instance.
/// </summary>
Task Restart();
/// <summary>
/// Gets the application version.
/// </summary>
/// <value>The application version.</value>
Version ApplicationVersion { get; }
2013-02-22 05:23:06 +01:00
/// <summary>
/// Gets or sets a value indicating whether this instance can self update.
/// </summary>
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
bool CanSelfUpdate { get; }
/// <summary>
/// Gets a value indicating whether this instance is first run.
/// </summary>
/// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
bool IsFirstRun { get; }
2013-02-24 22:53:54 +01:00
/// <summary>
/// Gets the failed assemblies.
/// </summary>
/// <value>The failed assemblies.</value>
List<string> FailedAssemblies { get; }
2013-02-24 22:53:54 +01:00
/// <summary>
/// Gets all concrete types.
/// </summary>
/// <value>All concrete types.</value>
Type[] AllConcreteTypes { get; }
/// <summary>
/// Gets the exports.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="manageLiftime">if set to <c>true</c> [manage liftime].</param>
/// <returns>IEnumerable{``0}.</returns>
IEnumerable<T> GetExports<T>(bool manageLiftime = true);
2013-02-22 05:23:06 +01:00
/// <summary>
/// Checks for update.
/// </summary>
/// <returns>Task{CheckForUpdateResult}.</returns>
Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Updates the application.
/// </summary>
/// <returns>Task.</returns>
Task UpdateApplication(PackageVersionInfo package, CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Resolves this instance.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>``0.</returns>
2013-02-23 08:57:11 +01:00
T Resolve<T>();
/// <summary>
/// Resolves this instance.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>``0.</returns>
T TryResolve<T>();
/// <summary>
/// Shuts down.
/// </summary>
Task Shutdown();
/// <summary>
/// Gets the plugins.
/// </summary>
/// <value>The plugins.</value>
IPlugin[] Plugins { get; }
/// <summary>
/// Removes the plugin.
/// </summary>
/// <param name="plugin">The plugin.</param>
void RemovePlugin(IPlugin plugin);
/// <summary>
/// Inits this instance.
/// </summary>
/// <param name="progress">The progress.</param>
/// <returns>Task.</returns>
Task Init(IProgress<double> progress);
2013-10-03 16:14:40 +02:00
/// <summary>
/// Creates the instance.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>System.Object.</returns>
object CreateInstance(Type type);
}
}