Example #1
0
 /// <summary>
 /// Creates a new Functions instance.
 /// </summary>
 /// <param name="service">The sevis batch processing service.</param>
 /// <param name="appSettings">The app settings.</param>
 public Functions(ISevisBatchProcessingService service, ISevisApiResponseHandler responseHandler, IEcaHttpMessageHandlerService theEcaHttpMessageHandlerService, AppSettings appSettings)
 {
     Contract.Requires(service != null, "The service must not be null.");
     Contract.Requires(responseHandler != null, "The response handler must not be null.");
     Contract.Requires(appSettings != null, "The app settings must not be null.");
     Contract.Requires(theEcaHttpMessageHandlerService != null, "The app settings must not be null.");
     this.responseHandler = responseHandler;
     this.service         = service;
     this.ecaHttpMessageHandlerService = theEcaHttpMessageHandlerService;
     this.appSettings = appSettings;
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.service is IDisposable)
         {
             logger.Trace("Disposing of service " + this.service.GetType());
             ((IDisposable)this.service).Dispose();
             this.service = null;
         }
         if (this.responseHandler is IDisposable)
         {
             logger.Trace("Disposing of response handler " + this.responseHandler.GetType());
             ((IDisposable)this.responseHandler).Dispose();
             this.responseHandler = null;
         }
         if (this.ecaHttpMessageHandlerService is IDisposable)
         {
             logger.Trace("Disposing of response handler " + this.ecaHttpMessageHandlerService.GetType());
             ((IDisposable)this.ecaHttpMessageHandlerService).Dispose();
             this.ecaHttpMessageHandlerService = null;
         }
     }
 }