コード例 #1
0
        private NotificationServiceHost <T> CreateHostInstance()
        {
            var host = new NotificationServiceHost <T>(this, _baseAddress, _eventService);

            AddHostEndpoint(host);
            return(host);
        }
コード例 #2
0
        /// <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
                );
        }
コード例 #3
0
 private void OpenHost()
 {
     _host = CreateHostInstance();
     try
     {
         _host.Open();
     }
     catch (Exception ex)
     {
         TraceHelper.TraceError(_traceSwitch, ex);
         throw;
     }
 }
コード例 #4
0
        /// <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);
        }