using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using MediaBrowser.Common.Plugins;
using Microsoft.Extensions.DependencyInjection;
namespace MediaBrowser.Common
{
///
/// An interface to be implemented by the applications hosting a kernel.
///
public interface IApplicationHost
{
///
/// Occurs when [has pending restart changed].
///
event EventHandler HasPendingRestartChanged;
///
/// Gets the name.
///
/// The name.
string Name { get; }
///
/// Gets the device identifier.
///
/// The device identifier.
string SystemId { get; }
///
/// Gets a value indicating whether this instance has pending kernel reload.
///
/// true if this instance has pending kernel reload; otherwise, false.
bool HasPendingRestart { get; }
///
/// Gets a value indicating whether this instance is currently shutting down.
///
/// true if this instance is shutting down; otherwise, false.
bool IsShuttingDown { get; }
///
/// Gets a value indicating whether this instance can self restart.
///
/// true if this instance can self restart; otherwise, false.
bool CanSelfRestart { get; }
///
/// Gets the application version.
///
/// The application version.
Version ApplicationVersion { get; }
///
/// Gets the application version.
///
/// The application version.
string ApplicationVersionString { get; }
///
/// Gets the application user agent.
///
/// The application user agent.
string ApplicationUserAgent { get; }
///
/// Gets the email address for use within a comment section of a user agent field.
/// Presently used to provide contact information to MusicBrainz service.
///
string ApplicationUserAgentAddress { get; }
///
/// Gets the plugins.
///
/// The plugins.
IReadOnlyList Plugins { get; }
///
/// Notifies the pending restart.
///
void NotifyPendingRestart();
///
/// Restarts this instance.
///
void Restart();
///
/// Gets the exports.
///
/// The type.
/// If set to true [manage lifetime].
/// .
IReadOnlyCollection GetExports(bool manageLifetime = true);
///
/// Resolves this instance.
///
/// The Type.
/// ``0.
T Resolve();
///
/// Shuts down.
///
/// A task.
Task Shutdown();
///
/// Removes the plugin.
///
/// The plugin.
void RemovePlugin(IPlugin plugin);
///
/// Initializes this instance.
///
/// The service collection.
void Init(IServiceCollection serviceCollection);
///
/// Creates the instance.
///
/// The type.
/// System.Object.
object CreateInstance(Type type);
}
}