コード例 #1
0
        private void c_UsersReceived(object sender, UsersReceivedEventArgs e)
        {
            string selectedName = string.Empty;

            if (lbUsers.SelectedItems.Count > 0)
            {
                selectedName = ((LoggedinUserClient)lbUsers.SelectedItems[0]).Name;
            }

            //----------------------- lista feltöltése
            List <LoggedinUserClient> ul = (from item in e.users1
                                            select new LoggedinUserClient
            {
                Name = item.Name,
                ImageSource = item.Sex == 1 ? malepic.Source : femalepic.Source
            }).ToList();

            //lbUsers.ItemsSource = null;
            lbUsers.ItemsSource = ul;
            //--------------------------------

            if (selectedName != string.Empty)
            {
                SelectMarkedUser(selectedName, ul);
            }


            RemoveInvalidUsersFromRequests();
        }
コード例 #2
0
        void c_UsersReceived(object sender, UsersReceivedEventArgs e)
        {
            List <string> u = e.users1.ToList();

            lbUsers.Items.Clear();
            foreach (string item in u)
            {
                lbUsers.Items.Add(item);
            }
        }
コード例 #3
0
 private void OnUsersReceived(object sender, UsersReceivedEventArgs e)
 {
     UsersReceived?.Invoke(this, e);
 }