private void ListContacts_MouseDoubleClick(object sender, MouseButtonEventArgs e) { BusinessLayer.ConversationManager cm = new BusinessLayer.ConversationManager(); if (ListContact.SelectedItem != null) { EntityLayer.Conversation c; c = cm.getConversationsFromContact(((ContactModelView)ListContact.SelectedItem).Contact.Num); if (c == null) { cm.AddConversation(((ContactModelView)ListContact.SelectedItem).Contact); IList<EntityLayer.Conversation> convs = cm.getConversations(); ViewModel.Conversation.ConversationsModelView cmv = new ViewModel.Conversation.ConversationsModelView(convs); parentWindow.ListConversations.DataContext = cmv; } if (!parentWindow.findConvos(((ContactModelView)ListContact.SelectedItem).Contact.Num)) { Conversation cw = new Conversation(parentWindow, ((ContactModelView)ListContact.SelectedItem).Contact.Num); parentWindow.addConv(cw); cw.Show(); } } }
private void AppButton_Click(object sender, EventArgs e) { BusinessLayer.ConversationManager cm = new BusinessLayer.ConversationManager(); if(TextField.Text.Length > 0) { EntityLayer.SMS sms = new EntityLayer.SMS(TextField.Text, cm.getContactFromString(contact)); cm.AddMessageToConv(sms, cm.getConversationsFromContact(contact)); EntityLayer.Conversation convs = cm.getConversationsFromContact(contact); ViewModel.SMS.SMSsModelView cmv = new ViewModel.SMS.SMSsModelView(convs.Messages); FilConv.DataContext = cmv; UsbManager manager = UsbManager.getInstance(null); manager.send(sms); IList<EntityLayer.Conversation> convs2 = cm.getConversations(); ViewModel.Conversation.ConversationsModelView cmv2 = new ViewModel.Conversation.ConversationsModelView(convs2); parent.ListConversations.DataContext = cmv2; TextField.Text = ""; } }
private void AppWindow_Loaded(object sender, RoutedEventArgs e) { BusinessLayer.ConversationManager cm = new BusinessLayer.ConversationManager(); Import_Conv_Click(this, null); Import_Cont_Click(this, null); IList<EntityLayer.Conversation> convs = cm.getConversations(); ViewModel.Conversation.ConversationsModelView cmv = new ViewModel.Conversation.ConversationsModelView(convs); ListConversations.DataContext = cmv; }