jellyfin/MediaBrowser.Controller/BaseManager.cs

51 lines
1.5 KiB
C#
Raw Normal View History

using MediaBrowser.Common.Kernel;
using System;
2013-02-21 01:33:05 +00:00
namespace MediaBrowser.Controller
2013-02-21 01:33:05 +00:00
{
/// <summary>
/// Class BaseManager
/// </summary>
/// <typeparam name="TKernelType">The type of the T kernel type.</typeparam>
public abstract class BaseManager<TKernelType> : IDisposable
2013-02-21 21:39:53 +00:00
where TKernelType : class, IKernel
2013-02-21 01:33:05 +00:00
{
/// <summary>
/// The _kernel
/// </summary>
protected readonly TKernelType Kernel;
/// <summary>
/// Initializes a new instance of the <see cref="BaseManager" /> class.
/// </summary>
/// <param name="kernel">The kernel.</param>
2013-02-21 05:00:56 +00:00
/// <exception cref="System.ArgumentNullException">kernel</exception>
2013-02-21 01:33:05 +00:00
protected BaseManager(TKernelType kernel)
{
2013-02-21 05:00:56 +00:00
if (kernel == null)
{
throw new ArgumentNullException("kernel");
}
2013-02-21 21:39:53 +00:00
2013-02-21 01:33:05 +00:00
Kernel = kernel;
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool dispose)
{
}
}
}