public virtual void StartOrJoinPresentation(SocketSubscription sender, TextMessage message)
        {
            var cmd = message.ToCommand<StartOrJoinPresentation>();

            var presentation = Presentations.GetPresentationByName(cmd.Name);
            if(presentation == null)
                OnStartPresentation(cmd, sender);
            else
                OnJoinPresentation(presentation, sender);
        }
        public virtual void ChangeSlide(SocketSubscription sender, TextMessage message)
        {
            var cmd = message.ToCommand<ChangeSlide>();
            var presentation = Presentations.GetPresentationIfPresenter(sender);
            if (presentation == null)
                return;

            if(presentation.Presenter.ChangeSlide(cmd.NewSlide))
                sender.Server.BroadCastEvent(
                    presentation.GetAttendees().Select(a => a.Subscription),
                    new SlideChanged
                    {
                        NewSlide = cmd.NewSlide
                    });
        }
 protected virtual void OnRecieved(SocketSubscription subscription, TextMessage message)
 {
     if(message.Action.Equals("Ping", StringComparison.OrdinalIgnoreCase))
     {
         OnPing(subscription, message);
         return;
     }
     Parallel.ForEach(Routes.GetMathingTextMessageRoutes(message.Action, subscription), r => r.Handler(subscription, message));
 }
 protected virtual void OnPing(SocketSubscription subscription, TextMessage message)
 {
     subscription.Connection.SendResponse("OnPinged", "Echo: '{0}'.".Inject(message.Data));
 }