コード例 #1
0
 public void RaiseEditSuccess(UserModel newUserSetting)
 {
     if (this.EditSuccess != null)
     {
         this.EditSuccess(this, new LoginSuccessArgs(newUserSetting));
     }
 }
コード例 #2
0
 private void RaiseRegisterSuccess(UserModel registeredUser)
 {
     if(this.RegisterSuccess != null)
     {
         this.RegisterSuccess(this, new RegisterSuccessArgs(registeredUser));
     }
 }
コード例 #3
0
 private void RaiseLoginSuccess(UserModel loggedUser)
 {
     if (this.LoginSuccess != null)
     {
         this.LoginSuccess(this, new LoginSuccessArgs(loggedUser));
     }
 }
コード例 #4
0
        public ProfileViewModel(UserModel currentUserSettings)
        {
            this.CurrentUserSettings = currentUserSettings;
            this.Username = currentUserSettings.Username;
            this.LastName = currentUserSettings.LastName;
            this.FirstName = currentUserSettings.FirstName;
            this.ProfilePictureUrl = currentUserSettings.ProfilePictureUrl;

            OnPropertyChanged("Username");
            OnPropertyChanged("LastName");
            OnPropertyChanged("FirstName");
            OnPropertyChanged("ProfilePictureUrl");
        }
コード例 #5
0
        public ViewUserProfileVewModel(UserModel selectedContact)
        {
            this.SelectedContact = selectedContact;
            this.Username = selectedContact.Username;
            this.LastName = selectedContact.LastName;
            this.FirstName = selectedContact.FirstName;
            this.ProfilePictureUrl = selectedContact.ProfilePictureUrl;

            OnPropertyChanged("Username");
            OnPropertyChanged("LastName");
            OnPropertyChanged("FirstName");
            OnPropertyChanged("ProfilePictureUrl");
        }
コード例 #6
0
        public ConversationViewModel(ConversationModel conversation, UserModel currentUser, UserModel partner)
        {
            this.CurrentConversation = conversation;
            this.CurrentUserInfo = currentUser;
            this.Partner = partner;
            this.CurrentConversation.Messages =
                MessagePersister.GetAllMsgsByConversation(CurrentUserInfo.SessionKey,
                                                            CurrentConversation.Id);

            OnPropertyChanged("CurrentConversation");

            pubnub = new PubnubAPI(PUBLISH_KEY, SUBSCRIBE_KEY, SECRET_KEY, true);

            var minId = Math.Min(CurrentUserInfo.Id, Partner.Id);
            var maxId = Math.Max(CurrentUserInfo.Id, Partner.Id);
            channelName = string.Format("channel-{0}-{1}",
                                               minId, maxId);

            Thread t = new Thread(() =>
                                  pubnub.Subscribe(channelName, HandleNewMessageReceived));
            t.IsBackground = true;
            t.Start();
        }
コード例 #7
0
 public ViewContactProfileArgs(UserModel userSettings)
     : base()
 {
     this.ContactInfo = userSettings;
 }
コード例 #8
0
 public RegisterSuccessArgs(UserModel user) : base()
 {
     this.RegisteredUser = user;
 }
コード例 #9
0
 public GeneralViewModel(UserModel currentUser)
 {
     this.CurrentUser = currentUser;
     ReloadContacts();
     this.FoundContacts = new List<UserModel>(this.Contacts);
 }
コード例 #10
0
 public LoginSuccessArgs(UserModel userSettings)
     : base()
 {
     this.UserSetting = userSettings;
 }