/// <summary>
 /// Registers the with service locator.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="locator">The locator.</param>
 /// <param name="name">The name.</param>
 /// <returns></returns>
 public static Lazy <IServiceLog> RegisterWithServiceLocator(this Lazy <IServiceLog> service, IServiceLocator locator, string name)
 {
     ServiceLogManager.GetSetupDescriptor(service).RegisterWithServiceLocator(service, locator, name); return(service);
 }
 /// <summary>
 /// Registers the with service locator.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="service">The service.</param>
 /// <param name="locator">The locator.</param>
 /// <returns></returns>
 public static Lazy <IServiceLog> RegisterWithServiceLocator <T>(this Lazy <IServiceLog> service, IServiceLocator locator)
     where T : class, IServiceLog
 {
     ServiceLogManager.GetSetupDescriptor(service).RegisterWithServiceLocator <T>(service, locator, null); return(service);
 }
 /// <summary>
 /// Registers the with service locator.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="locator">The locator.</param>
 /// <returns></returns>
 public static Lazy <IServiceLog> RegisterWithServiceLocator(this Lazy <IServiceLog> service, Lazy <IServiceLocator> locator)
 {
     ServiceLogManager.GetSetupDescriptor(service).RegisterWithServiceLocator(service, locator, null); return(service);
 }
 /// <summary>
 /// Registers the with service locator.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="name">The name.</param>
 /// <returns></returns>
 public static Lazy <IServiceLog> RegisterWithServiceLocator <T>(this Lazy <IServiceLog> service, string name)
     where T : class, IServiceLog
 {
     ServiceLogManager.GetSetupDescriptor(service).RegisterWithServiceLocator <T>(service, ServiceLocatorManager.Lazy, name); return(service);
 }
示例#5
0
 public void Null_Provider_Throws_InvalidOperation_Exception()
 {
     ServiceLogManager.SetProvider(null);
     var locator = ServiceLogManager.Current;
 }
 /// <summary>
 /// Loads from configuration.
 /// </summary>
 /// <param name="service">The service.</param>
 /// <param name="configuration">The configuration.</param>
 /// <returns></returns>
 public static Lazy <IServiceLog> LoadFromConfiguration(this Lazy <IServiceLog> service, ServiceLogConfiguration configuration)
 {
     ServiceLogManager.GetSetupDescriptor(service).LoadFromConfiguration(service, configuration); return(service);
 }