private void SessionManagerListener_SessionUserChanged(MixedRealityToolkit.Sharing.Session session, MixedRealityToolkit.Sharing.User XUser)
 {
     if (this.IsValid && this.Session.GetName().IsEqual(session.GetName()))
     {
         UpdateUser(XUser);
     }
 }
 private void SessionManagerListener_SessionUserLeft(MixedRealityToolkit.Sharing.Session session, MixedRealityToolkit.Sharing.User XUser)
 {
     if (this.IsValid && this.Session.GetName().IsEqual(session.GetName()))
     {
         OnPropertyChanged("UserCount");
         RemoveUser(XUser);
     }
 }
 private void SessionManagerListener_SessionClosed(MixedRealityToolkit.Sharing.Session session)
 {
     App.Current.Dispatcher.BeginInvoke(new Action <SessionsList>((sender) =>
     {
         SessionData existingSessionData = FindSession(session);
         if (existingSessionData != null)
         {
             Remove(existingSessionData);
         }
     }), new object[] { this }).Wait();
 }
 private void SessionListener_SessionManagerAdded(MixedRealityToolkit.Sharing.Session session)
 {
     App.Current.Dispatcher.BeginInvoke(new Action <SessionsList>((sender) =>
     {
         // Register the new session
         SessionData existingSessionData = FindSession(session);
         if (existingSessionData == null)
         {
             Add(new SessionData(session));
         }
     }), new object[] { this }).Wait();
 }
        public SessionData(MixedRealityToolkit.Sharing.Session session)
        {
            this.Session      = session;
            this.sessionUsers = new ObservableCollection <User>();

            if (this.Session != null)
            {
                App.XToolsApp.SessionDisconnected += XToolsApp_ServerDisconnected;

                App.XToolsApp.SessionManagerListener.SessionUserJoined  += SessionManagerListener_SessionUserJoined;
                App.XToolsApp.SessionManagerListener.SessionUserLeft    += SessionManagerListener_SessionUserLeft;
                App.XToolsApp.SessionManagerListener.SessionUserChanged += SessionManagerListener_SessionUserChanged;

                this.SessionListener = new XToolsSessionListener(this.Session);
                this.Session.AddListener(this.SessionListener);

                this.SessionListener.JoinSucceeded       += SessionListener_SessionChanged;
                this.SessionListener.SessionDisconnected += SessionListener_SessionChanged;
                this.SessionListener.JoinFailed          += SessionListener_SessionChanged;
                this.SessionListener.JoiningSession      += SessionListener_SessionChanged;

                BuildUserList();
            }
        }
        public SessionData FindSession(MixedRealityToolkit.Sharing.Session session)
        {
            SessionData existingSessionData = session != null?this.FirstOrDefault(x => x.Session.GetName().IsEqual(session.GetName())) : null;

            return(existingSessionData);
        }
 private void SessionListener_SessionChanged(MixedRealityToolkit.Sharing.Session session)
 {
     OnPropertyChanged("Joinable");
     OnPropertyChanged("Status");
     OnPropertyChanged("IsValid");
 }
Пример #8
0
 private void SessionManagerListener_SessionAdded(MixedRealityToolkit.Sharing.Session session)
 {
     UpdateCurrentSession();
 }