private void Contactsview_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Contact uus = new Contact();
            List<string> result = new List<string>();
            
            if (Contactsview.SelectedIndex >= 0)
            {
                uus = klient.getContactsByUser(top1.LoggedUser, 10).ToList().ElementAt(Contactsview.SelectedIndex);
                con_help = uus;
            }
            if (uus != null)
            {
                detailview.Items.Clear();
                detailview.Items.Add("FirstName: " + uus.FirstName.ToString());
                detailview.Items.Add("LastName: " + uus.LastName.ToString());
                detailview.Items.Add("Telefon: " + uus.Tel.ToString());
                detailview.Items.Add("Email: " + uus.Email.ToString());
                detailview.Items.Add("Skype: " + uus.Skype.ToString());
                detailview.Items.Add("Adress: " + uus.Address.ToString());
                if (uus.Muudetud != null)
                {
                    detailview.Items.Add("Changed: " + uus.Muudetud.ToString());
                }
                detailview.Items.Add("Created: " + uus.Loodud.ToString());

            }

        }
        private void Contactslist_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Contact uus = new Contact();
            List<string> result = new List<string>();

            if (Contactslist.SelectedIndex >= 0)
            {

                if (usr_help != null)
                {
                    uus = klient.getContactsByUser(usr_help, 10).ToList().ElementAt(Contactslist.SelectedIndex);
                }
                else if (radioButtonSkype.IsChecked == true)
                {
                    uus = klient.getContactBySkype(srch_text_help, 10).ToList().ElementAt(Contactslist.SelectedIndex);
                }
                else if (radioButtonName.IsChecked == true)
                {
                    uus = klient.getContactByName(srch_text_help, 10).ToList().ElementAt(Contactslist.SelectedIndex);
                }
                else if (radioButtonTel.IsChecked == true)
                {
                    uus = klient.getContactBytel(srch_text_help, 10).ToList().ElementAt(Contactslist.SelectedIndex);
                }
                else if (radioButtonSkype.IsChecked == true)
                {
                    uus = klient.getContactByEmail(srch_text_help, 10).ToList().ElementAt(Contactslist.SelectedIndex);
                }
                else
                {
                    MainWindow top = (MainWindow)Window.GetWindow(this);
                    uus = klient.getContactsByUser(top.LoggedUser, 10).ToList().ElementAt(Contactslist.SelectedIndex);
                }
                
            }
            if (uus != null)
            {
                deatilslist.Items.Clear();
                if (uus.FirstName != null)
                {
                    deatilslist.Items.Add("FirstName: " + uus.FirstName.ToString());
                }
                if (uus.LastName != null)
                {
                    deatilslist.Items.Add("LastName: " + uus.LastName.ToString());
                }
                if (uus.Tel != null)
                {
                 deatilslist.Items.Add("Telefon: " + uus.Tel.ToString());
                }
                if (uus.Email != null)
                {
                    deatilslist.Items.Add("Email: " + uus.Email.ToString());
                }
                if (uus.Skype != null)
                {
                 deatilslist.Items.Add("Skype: " + uus.Skype.ToString());
                }
                 if (uus.Address != null)
                {
                    deatilslist.Items.Add("Adress: " + uus.Address.ToString());
                }
                if (uus.Muudetud != null)
                {
                    deatilslist.Items.Add("Changed: " + uus.Muudetud.ToString());
                }
                if (uus.Loodud != null)
                {
                    deatilslist.Items.Add("Created: " + uus.Loodud.ToString());
                }
                usr_help = null;
            }
        }
示例#3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 10 "..\..\..\Messanger.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 2:
                this.chat = ((System.Windows.Controls.TabItem)(target));
                return;

            case 3:
                this.mainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:

            #line 59 "..\..\..\Messanger.xaml"
                ((System.Windows.Controls.DockPanel)(target)).KeyUp += new System.Windows.Input.KeyEventHandler(this.DockPanel_KeyUp_Searching);

            #line default
            #line hidden
                return;

            case 5:
                this.search_textbox = ((System.Windows.Controls.TextBox)(target));

            #line 60 "..\..\..\Messanger.xaml"
                this.search_textbox.GotFocus += new System.Windows.RoutedEventHandler(this.search_textbox_GotFocus);

            #line default
            #line hidden

            #line 60 "..\..\..\Messanger.xaml"
                this.search_textbox.LostFocus += new System.Windows.RoutedEventHandler(this.search_textbox_LostFocus);

            #line default
            #line hidden
                return;

            case 6:
                this.chatName_textbox = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 7:
                this.Close_button = ((System.Windows.Controls.Button)(target));

            #line 65 "..\..\..\Messanger.xaml"
                this.Close_button.Click += new System.Windows.RoutedEventHandler(this.Close_button_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.ContactList_listBox = ((System.Windows.Controls.ListBox)(target));

            #line 69 "..\..\..\Messanger.xaml"
                this.ContactList_listBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ContactList_listBox_SelectionChanged);

            #line default
            #line hidden
                return;

            case 9:
                this.MyContact = ((Client.Contact)(target));
                return;

            case 10:
                this.Label_ServerConnect = ((System.Windows.Controls.Label)(target));
                return;

            case 11:
                this.chatBody_scroll = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 12:

            #line 91 "..\..\..\Messanger.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 13:
                this.chatBody_listBox = ((System.Windows.Controls.ListBox)(target));
                return;

            case 14:

            #line 105 "..\..\..\Messanger.xaml"
                ((System.Windows.Controls.DockPanel)(target)).KeyUp += new System.Windows.Input.KeyEventHandler(this.DockPanel_KeyUp);

            #line default
            #line hidden
                return;

            case 15:
                this.sendMessage_textBox = ((System.Windows.Controls.TextBox)(target));

            #line 106 "..\..\..\Messanger.xaml"
                this.sendMessage_textBox.GotFocus += new System.Windows.RoutedEventHandler(this.sendMessage_textBox_GotFocus);

            #line default
            #line hidden

            #line 106 "..\..\..\Messanger.xaml"
                this.sendMessage_textBox.LostFocus += new System.Windows.RoutedEventHandler(this.sendMessage_textBox_LostFocus);

            #line default
            #line hidden
                return;

            case 16:
                this.sendFile_button1 = ((System.Windows.Controls.Button)(target));

            #line 110 "..\..\..\Messanger.xaml"
                this.sendFile_button1.Click += new System.Windows.RoutedEventHandler(this.sendFile_button1_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.sendSmile_button2 = ((System.Windows.Controls.Button)(target));

            #line 120 "..\..\..\Messanger.xaml"
                this.sendSmile_button2.Click += new System.Windows.RoutedEventHandler(this.sendSmile_button2_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.sendMessage_button3 = ((System.Windows.Controls.Button)(target));

            #line 131 "..\..\..\Messanger.xaml"
                this.sendMessage_button3.Click += new System.Windows.RoutedEventHandler(this.sendMessage_button3_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.sendMessage_button4 = ((System.Windows.Controls.Button)(target));

            #line 132 "..\..\..\Messanger.xaml"
                this.sendMessage_button4.Click += new System.Windows.RoutedEventHandler(this.sendMessage_button4_Click);

            #line default
            #line hidden
                return;

            case 20:
                this.sendMessage_button = ((System.Windows.Controls.Button)(target));

            #line 133 "..\..\..\Messanger.xaml"
                this.sendMessage_button.Click += new System.Windows.RoutedEventHandler(this.sendMessage_button_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.groups = ((System.Windows.Controls.TabItem)(target));
                return;

            case 22:
                this.settings = ((System.Windows.Controls.TabItem)(target));
                return;

            case 23:
                this.support = ((System.Windows.Controls.TabItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#4
0
        public void ProcessContactResponse(ContactResponse contactResponse)
        {
            Contact tempContact = new Contact
            {
                Id = contactResponse.Contact.Id,
                Login = contactResponse.Contact.Login,
                Email = contactResponse.Contact.Email,
                AvatarBytes = (contactResponse.Contact.ImageBytes == null ? App.GetDefaultAvatar() : contactResponse.Contact.ImageBytes)
            };

            if (!Contacts.Contains(tempContact))
                Contacts.Add(tempContact);
        }
示例#5
0
        void RequestContact()
        {
            ContactRequest contactRequest = new ContactRequest();

            contactRequest.ContactID = SelectedContact.Id;
            Contacts.Remove(SelectedContact);
            SelectedContact = null;
            AsynchronousClientSocket.Send(contactRequest.CreateTransferablePacket());
        }