2019-01-13 13:01:16 -07:00
|
|
|
using System;
|
2018-12-27 16:27:57 -07:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading.Tasks;
|
2019-01-13 12:25:11 -07:00
|
|
|
using MediaBrowser.Common.Plugins;
|
|
|
|
using MediaBrowser.Model.Events;
|
|
|
|
using MediaBrowser.Model.Updates;
|
2019-02-03 09:09:12 -07:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
namespace MediaBrowser.Common
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// An interface to be implemented by the applications hosting a kernel
|
|
|
|
/// </summary>
|
|
|
|
public interface IApplicationHost
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the name.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The name.</value>
|
|
|
|
string Name { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the device identifier.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The device identifier.</value>
|
|
|
|
string SystemId { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Occurs when [application updated].
|
|
|
|
/// </summary>
|
|
|
|
event EventHandler<GenericEventArgs<PackageVersionInfo>> ApplicationUpdated;
|
|
|
|
|
|
|
|
/// <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; }
|
|
|
|
|
|
|
|
bool IsShuttingDown { get; }
|
|
|
|
|
|
|
|
/// <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; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Occurs when [has pending restart changed].
|
|
|
|
/// </summary>
|
|
|
|
event EventHandler HasPendingRestartChanged;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Notifies the pending restart.
|
|
|
|
/// </summary>
|
|
|
|
void NotifyPendingRestart();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Restarts this instance.
|
|
|
|
/// </summary>
|
|
|
|
void Restart();
|
|
|
|
|
2019-01-19 17:12:44 -07:00
|
|
|
/// <summary>
|
2019-01-19 19:35:33 -07:00
|
|
|
/// Gets the application version.
|
2019-01-19 17:12:44 -07:00
|
|
|
/// </summary>
|
2019-01-19 19:35:33 -07:00
|
|
|
/// <value>The application version.</value>
|
|
|
|
string ApplicationVersion { get; }
|
2019-01-19 17:12:44 -07:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the application user agent.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The application user agent.</value>
|
|
|
|
string ApplicationUserAgent { get; }
|
|
|
|
|
2019-03-14 14:32:27 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the email address for use within a comment section of a user agent field.
|
|
|
|
/// Presently used to provide contact information to MusicBrainz service.
|
|
|
|
/// </summary>
|
|
|
|
string ApplicationUserAgentAddress { get; }
|
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
/// <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>
|
2019-01-27 02:20:05 -07:00
|
|
|
IEnumerable<T> GetExports<T>(bool manageLifetime = true);
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Resolves this instance.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
/// <returns>``0.</returns>
|
|
|
|
T Resolve<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>
|
2019-03-07 09:39:40 -07:00
|
|
|
Task InitAsync(IServiceCollection serviceCollection);
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates the instance.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
/// <returns>System.Object.</returns>
|
|
|
|
object CreateInstance(Type type);
|
|
|
|
|
|
|
|
PackageVersionClass SystemUpdateLevel { get; }
|
|
|
|
}
|
|
|
|
}
|