コード例 #1
0
 public void AddChatUser(Guid guid, string name)
 {
     System.Diagnostics.Debug.WriteLine("Adding chatuser " + guid.ToString());
     ChatUserModel entry = new ChatUserModel(guid, name);
     if (!chatUsers.Contains(entry))
     {
         System.Diagnostics.Debug.WriteLine("added user " + name);
         this.chatUsers.Add(entry);
     }
 }
コード例 #2
0
 /// <summary>
 /// Event handler which is triggered when the user selection in the UI changes
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ui_UserList_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     ChatUserModel selectedUser = e.AddedItems[0] as ChatUserModel;
     if (selectedUser == null)
         System.Diagnostics.Debug.WriteLine("Couldn't cast eventargs to UserModel");
     else
     {
         RemoteReference userReference;
         if (this.chatUsers.TryGetValue(selectedUser.guid, out userReference))
         {
             currentPartner = userReference;
             currentPartnerModel = selectedUser;
         }
         else
             System.Diagnostics.Debug.WriteLine("Couldn't find selected user " + selectedUser.guid.ToString());
     }
 }
コード例 #3
0
        /// <summary>
        /// Join the chat with a certain user. Will change switch to the communication page.
        /// </summary>
        /// <param name="partner">Partner with whom we want to chat</param>
        /// <param name="partnerModel">The model of our current partner</param>
        /// 
        private void JoinChat(RemoteReference partner, ChatUserModel partnerModel)
        {
            this.currentPartner = partner;
            this.currentPartnerModel = partnerModel;

            partner.AsyncInvoke("EnteredChatNotification", this.myChatUser.GetName());
            Frame.Navigate(typeof(CommunicationPage), new PageInformation(partner, partnerModel.nickname, this.myChatUser));
        }
コード例 #4
0
        /// <summary>
        /// Join the chat with a certain user. Will change switch to the communication page.
        /// </summary>
        /// <param name="partner">Partner with whom we want to chat</param>
        /// <param name="partnerModel">The model of our current partner</param>
        private void JoinChat(RemoteReference partner, ChatUserModel partnerModel)
        {
            this.currentPartner = partner;
            this.currentPartnerModel = partnerModel;
            PhoneApplicationService.Current.State["CurrentPartner"] = partner;
            PhoneApplicationService.Current.State["PartnerNickname"] = partnerModel.nickname;
            PhoneApplicationService.Current.State["MyChatUser"] = this.myChatUser;

            partner.AsyncInvoke("EnteredChatNotification", this.myChatUser.GetName());
            NavigationService.Navigate(communicationPageURI);
        }