using MediaBrowser.Common.Logging;
using MediaBrowser.Model.Logging;
using System;
namespace MediaBrowser.Common.Kernel
{
///
/// Class BaseManager
///
/// The type of the T kernel type.
public abstract class BaseManager : IDisposable
where TKernelType : IKernel
{
///
/// Gets the logger.
///
/// The logger.
protected ILogger Logger { get; private set; }
///
/// The _kernel
///
protected readonly TKernelType Kernel;
///
/// Initializes a new instance of the class.
///
/// The kernel.
/// kernel
protected BaseManager(TKernelType kernel)
{
if (kernel == null)
{
throw new ArgumentNullException("kernel");
}
Kernel = kernel;
Logger = LogManager.GetLogger(GetType().Name);
Logger.Info("Initializing");
}
///
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
///
public void Dispose()
{
Logger.Info("Disposing");
Dispose(true);
GC.SuppressFinalize(this);
}
///
/// Releases unmanaged and - optionally - managed resources.
///
/// true to release both managed and unmanaged resources; false to release only unmanaged resources.
protected virtual void Dispose(bool dispose)
{
}
}
}