using System; using System.Collections.Generic; using System.Reflection; using Microsoft.Extensions.DependencyInjection; namespace MediaBrowser.Common { /// /// Delegate used with GetExports{T}. /// /// Type to create. /// New instance of type type. public delegate object? CreationDelegateFactory(Type type); /// /// 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 changes requiring a restart. /// /// true if this instance has a pending restart; otherwise, false. bool HasPendingRestart { get; } /// /// Gets or sets a value indicating whether the application should restart. /// bool ShouldRestart { get; set; } /// /// Gets the application version. /// /// The application version. Version ApplicationVersion { get; } /// /// Gets or sets the service provider. /// IServiceProvider? ServiceProvider { get; set; } /// /// 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 all plugin assemblies which implement a custom rest api. /// /// An containing the plugin assemblies. IEnumerable GetApiPluginAssemblies(); /// /// Notifies the pending restart. /// void NotifyPendingRestart(); /// /// Gets the exports. /// /// The type. /// If set to true [manage lifetime]. /// . IReadOnlyCollection GetExports(bool manageLifetime = true); /// /// Gets the exports. /// /// The type. /// Delegate function that gets called to create the object. /// If set to true [manage lifetime]. /// . IReadOnlyCollection GetExports(CreationDelegateFactory defaultFunc, bool manageLifetime = true); /// /// Gets the export types. /// /// The type. /// IEnumerable{Type}. IEnumerable GetExportTypes(); /// /// Resolves this instance. /// /// The Type. /// ``0. T Resolve(); /// /// Initializes this instance. /// /// Instance of the interface. void Init(IServiceCollection serviceCollection); } }