private void RegisterEventHandlers(EventEnabledClientInformation service)
 {
     if (service.HandlerType == typeof(CommonsServiceEventsDefaultHandler))
     {
         var commonsHandler = Context.Resolve <CommonsServiceEventsDefaultHandler>();
         commonsHandler.Tick          += (date) => Writer.WriteLine(date);
         commonsHandler.BroadcastText += (txt) => Writer.WriteLine(txt);
     }
 }
 void UnsubscribeService(EventEnabledClientInformation service)
 {
     if (service.ClientInstance == null)
     {
         return;
     }
     foreach (var evt in service.Events)
     {
         service.ClientInstance.Unsubscribe(evt);
     }
 }
        void SubscribeService(EventEnabledClientInformation service)
        {
            if (service.ClientInstance == null)
            {
                service.ClientInstance = (ISubscriptionService)Context.Resolve(service.ClientType);
                RegisterEventHandlers(service);
            }

            foreach (var evt in service.Events)
            {
                service.ClientInstance.Subscribe(evt);
            }
        }
 void SubscribeService(EventEnabledClientInformation service)
 {
     if (service.ClientInstance == null)
     {
         service.ClientInstance = (ISubscriptionService)Context.Resolve(service.ClientType);
         RegisterEventHandlers(service);
     }
     
     foreach (var evt in service.Events)
     {
         service.ClientInstance.Subscribe(evt);
     }
 }
 void UnsubscribeService(EventEnabledClientInformation service)
 {
     if (service.ClientInstance == null) return;
     foreach (var evt in service.Events)
     {
         service.ClientInstance.Unsubscribe(evt);
     }
 }
 private void RegisterEventHandlers(EventEnabledClientInformation service)
 {
     if (service.HandlerType == typeof(CommonsServiceEventsDefaultHandler))
     {
         var commonsHandler = Context.Resolve<CommonsServiceEventsDefaultHandler>();
         commonsHandler.Tick += (date) => Writer.WriteLine(date);
         commonsHandler.BroadcastText += (txt) => Writer.WriteLine(txt);
     }
 }