Made DefaultLogger use the eventlog rather than debug.writeline(..) renamed service1 to CardReaderService #22
44 lines
958 B
C#
44 lines
958 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Ninject;
|
|
|
|
namespace CardReaderService
|
|
{
|
|
public class NinjectHelper
|
|
{
|
|
private static NinjectHelper _instance;
|
|
private static readonly object LockObject = new object();
|
|
|
|
public StandardKernel Kernel { get; private set; }
|
|
|
|
public static NinjectHelper GetInstance()
|
|
{
|
|
if (_instance != null)
|
|
return _instance;
|
|
lock (LockObject)
|
|
{
|
|
_instance = new NinjectHelper();
|
|
return _instance;
|
|
}
|
|
}
|
|
|
|
private NinjectHelper()
|
|
{
|
|
Kernel = Configuration.ConfigureNinject();
|
|
}
|
|
|
|
public T Get<T>()
|
|
{
|
|
return Kernel.Get<T>();
|
|
}
|
|
|
|
public IEnumerable<T> GetAll<T>()
|
|
{
|
|
return Kernel.GetAll<T>();
|
|
}
|
|
}
|
|
}
|