コード例 #1
0
        private void OnSessionStateChanged(XmppSessionState newState)
        {
            this.Dispatcher.BeginInvoke
            (
                DispatcherPriority.ApplicationIdle,
                new ThreadStart
                (
                    delegate
                    {
                        switch (newState)
                        {
                            case XmppSessionState.LoggedIn:
                                VisualStateManager.GoToState(this, "LoggedIn", true);
                                break;

                            case XmppSessionState.LoggingIn:
                                VisualStateManager.GoToState(this, "LoggingIn", false);
                                break;

                            case XmppSessionState.LoggingOut:
                                VisualStateManager.GoToState(this, "LoggingOut", true);
                                break;

                            case XmppSessionState.Error:
                                VisualStateManager.GoToState(this, "Error", true);
                                break;
                        }
                    }
                )
            );
        }
コード例 #2
0
        protected virtual void OnSessionStateChanged(XmppSessionState newState)
        {
            SubscribeToSessionState();

            if (newState == XmppSessionState.LoggingIn)
            {
                Subscribe();
            }
            else if (newState == XmppSessionState.LoggingOut)
            {
                Unsubscribe();
            }

            //NotifyAllPropertiesChanged();
        }
コード例 #3
0
 private void OnSessionStateChanged(XmppSessionState newState)
 {
     if (newState == XmppSessionState.LoggingIn)
     {
         this.Subscribe();
     }
     else if (newState == XmppSessionState.LoggingOut)
     {
         this.Unsubscribe();
     }
 }
コード例 #4
0
        protected virtual void OnSessionStateChanged(XmppSessionState newState)
        {
            SubscribeToSessionState();

            if (newState == XmppSessionState.LoggingIn)
            {
                Subscribe();
            }
            else if (newState == XmppSessionState.LoggingOut)
            {
                Unsubscribe();
            }

            //NotifyAllPropertiesChanged();
        }
コード例 #5
0
ファイル: LoginViewModel.cs プロジェクト: eightrivers/babelim
 private void OnSessionStateChanged(XmppSessionState newState)
 {
     Application.Current.Dispatcher.Invoke
     (
         (Action)delegate
         {
             if (newState == XmppSessionState.LoggedIn)
             {
                 this.Password = String.Empty;
             }
             else if (newState == XmppSessionState.LoggedOut)
             {
                 this.NotifyPropertyChanged(() => Accounts);
             }
         }
     );
 }
コード例 #6
0
        private void OnSessionStateChanged(XmppSessionState newState)
        {
            lock (SyncObject)
            {
                List<string>                                    removedViews    = new List<string>();
                IEnumerator<KeyValuePair<string, PivotItem>>    enumerator      = this.chatViews.GetEnumerator();

                while (enumerator.MoveNext())
                {
                    removedViews.Add(enumerator.Current.Key);
                }

                foreach (string jid in removedViews)
                {
                    this.CloseChatView(jid);
                }
            }

            this.Unsubscribe();
        }