public MainWindow()
 {
     InitializeComponent();
     hangouts = new Hangouts(System.ComponentModel.AsyncOperationManager.SynchronizationContext);
     hangouts.Connected += hangouts_Connected;
     hangouts.Connecting +=hangouts_Connecting;
     hangouts.ConnectFailed +=hangouts_ConnectFailed;
     hangouts.ConversationCreated += hangouts_ConversationCreated;
     hangouts.ConversationChatMessageSent += hangouts_ConversationChatMessageSent;
     hangouts.ConversationChatMessageReceived += hangouts_ConversationChatMessageReceived;
     hangouts.UserSearchCompleted += hangouts_UserSearchCompleted;
     hangouts.ConversationSynchronized +=hangouts_ConversationSynchronized;
 }
 private void hangouts_ConversationChatMessageReceived(object sender, Hangouts.ConversationChatMessageReceivedEventArgs e)
 {
     MessageBox.Show(e.ChatMessage.ChatMessage.Message);
 }
 private void hangouts_ConversationCreated(object sender, Hangouts.ConversationCreatedEventArgs e)
 {
     tbxConversationID.Text = e.ConversationID;
 }
 private void hangouts_UserSearchCompleted(object sender, Hangouts.UserSearchCompletedEventArgs e)
 {
     lstEntityResult.ItemsSource = e.IDs.Select(x => x.ChatID);
 }