void IServiceEnvironmentEventListener.ServiceScheduleRequestedEvent(ServiceScheduleRequestedEventArgs args)
 {
     if (ServiceScheduleRequested != null)
     {
         ServiceScheduleRequested(this, args);
     }
 }
        private void NotifyScheduleServiceRequest(ServiceScheduleRequestedEventArgs args)
        {
            RefreshEventListenersList();
            ServiceEnvironmentEventListenerInfo listenerInfo;

            if (!_environmentListeners.TryGetValue(ServiceEnvironmentEventType.ServiceScheduleRequested, out listenerInfo))
            {
                throw new ServiceEnvironmentException("Could not find a registered listener for ServiceScheduleRequested events in the database.");
            }

            try
            {
                using (var listener = new WcfClient <IServiceEnvironmentEventListener>(this, listenerInfo.EndpointName, listenerInfo.EndpointAddress))
                {
                    listener.Channel.ServiceScheduleRequestedEvent(args);
                }
            }
            catch (Exception ex)
            {
                throw new ServiceEnvironmentException(String.Format("Failed WCF call to the registered listener for ServiceScheduleRequested events ({0}).", listenerInfo.EndpointAddress), ex);
            }
        }