public static ResponseUser FromUser(SlackAPI.User user)
        {
            var u = new ResponseUser();

            u.id                  = user.id;
            u.name                = user.name;
            u.deleted             = user.deleted;
            u.color               = user.color;
            u.is_admin            = user.is_admin;
            u.is_owner            = user.is_owner;
            u.is_owner            = user.is_owner;
            u.is_primary_owner    = user.is_primary_owner;
            u.is_restricted       = user.is_restricted;
            u.is_ultra_restricted = user.is_ultra_restricted;
            u.has_2fa             = user.has_2fa;
            u.two_factor_type     = user.two_factor_type;
            u.has_files           = user.has_files;
            u.presence            = user.presence;
            u.is_bot              = user.is_bot;
            u.tz                  = user.tz;
            u.tz_label            = user.tz_label;
            u.tz_offset           = user.tz_offset;
            u.team_id             = user.team_id;
            u.real_name           = user.real_name;
            return(u);
        }
        public static ResponseUser GetAllUser()
        {
            var u = new ResponseUser();

            u.name = "All Users";
            u.id   = null;
            return(u);
        }
Ejemplo n.º 3
0
 private void AddUsers(UserListResponse response)
 {
     //ComboUser.Items.Clear();
     responseUsers.Clear();
     foreach (var user in response.members)
     {
         responseUsers.Add(ResponseUser.FromUser(user));
     }
     ComboUser.ItemsSource = null;
     responseUsers.Insert(0, ResponseUser.GetAllUser());  // insert the All Users user on top
     ComboUser.ItemsSource = responseUsers;
     ComboUser.Items.Refresh();
     ComboUser.SelectedIndex = 0;
     SetStatus($"Userlist received. ({responseUsers.Count-1} users)");
 }