private NotificationServiceHost <T> CreateHostInstance() { var host = new NotificationServiceHost <T>(this, _baseAddress, _eventService); AddHostEndpoint(host); return(host); }
/// <summary> /// Add the endpoint for the checkin event to the host. /// </summary> /// <param name="host"></param> /// <param name="binding"></param> private void AddHostEndpoint(NotificationServiceHost <T> host) { BasicHttpBinding binding = CreateHostBinding(); ServiceEndpoint endPoint = host.AddServiceEndpoint( typeof(INotificationService), binding, typeof(T).Name ); }
private void OpenHost() { _host = CreateHostInstance(); try { _host.Open(); } catch (Exception ex) { TraceHelper.TraceError(_traceSwitch, ex); throw; } }
/// <summary> /// Create the instance of the Notification Service. /// </summary> /// <returns></returns> private NotificationServiceHost <T> CreateHostInstance() { Uri baseAddress = GetBaseAddress(); NotificationServiceHost <T> host; if (!String.IsNullOrEmpty(Settings.Default.RegistrationUserName)) { host = new NotificationServiceHost <T>(this.GetType(), baseAddress, Settings.Default.RegistrationUserName); } else { host = new NotificationServiceHost <T>(this.GetType(), baseAddress); } AddHostEndpoint(host); return(host); }