Initial upload

This commit is contained in:
Greenback
2020-12-06 23:48:54 +00:00
parent f2c2beca0f
commit 7986465cf7
34 changed files with 1726 additions and 755 deletions

View File

@@ -2,11 +2,16 @@ using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using MediaBrowser.Common.Plugins;
using Microsoft.Extensions.DependencyInjection;
namespace MediaBrowser.Common
{
/// <summary>
/// Delegate used with GetExports{T}.
/// </summary>
/// <param name="type">Type to create.</param>
/// <returns>New instance of type <param>type</param>.</returns>
public delegate object CreationDelegate(Type type);
/// <summary>
/// An interface to be implemented by the applications hosting a kernel.
/// </summary>
@@ -53,6 +58,11 @@ namespace MediaBrowser.Common
/// <value>The application version.</value>
Version ApplicationVersion { get; }
/// <summary>
/// Gets or sets the service provider.
/// </summary>
IServiceProvider ServiceProvider { get; set; }
/// <summary>
/// Gets the application version.
/// </summary>
@@ -71,12 +81,6 @@ namespace MediaBrowser.Common
/// </summary>
string ApplicationUserAgentAddress { get; }
/// <summary>
/// Gets the plugins.
/// </summary>
/// <value>The plugins.</value>
IReadOnlyList<IPlugin> Plugins { get; }
/// <summary>
/// Gets all plugin assemblies which implement a custom rest api.
/// </summary>
@@ -101,6 +105,22 @@ namespace MediaBrowser.Common
/// <returns><see cref="IReadOnlyCollection{T}" />.</returns>
IReadOnlyCollection<T> GetExports<T>(bool manageLifetime = true);
/// <summary>
/// Gets the exports.
/// </summary>
/// <typeparam name="T">The type.</typeparam>
/// <param name="defaultFunc">Delegate function that gets called to create the object.</param>
/// <param name="manageLifetime">If set to <c>true</c> [manage lifetime].</param>
/// <returns><see cref="IReadOnlyCollection{T}" />.</returns>
IReadOnlyCollection<T> GetExports<T>(CreationDelegate defaultFunc, bool manageLifetime = true);
/// <summary>
/// Gets the export types.
/// </summary>
/// <typeparam name="T">The type.</typeparam>
/// <returns>IEnumerable{Type}.</returns>
IEnumerable<Type> GetExportTypes<T>();
/// <summary>
/// Resolves this instance.
/// </summary>
@@ -114,12 +134,6 @@ namespace MediaBrowser.Common
/// <returns>A task.</returns>
Task Shutdown();
/// <summary>
/// Removes the plugin.
/// </summary>
/// <param name="plugin">The plugin.</param>
void RemovePlugin(IPlugin plugin);
/// <summary>
/// Initializes this instance.
/// </summary>