private bool OnSelection(MaterialDialog dialog, int[] which, string[] text) { try { CategoryId = ""; CategoryName = ""; CategorySelect = new List <string>(); foreach (var t in which) { CategoryId += CategoriesController.ListCategories[t].Id + ","; CategoryName += CategoriesController.ListCategories[t].Name + ","; CategorySelect.Add(CategoryId); } TxtFavCategory.Text = CategoryName.Remove(CategoryName.Length - 1, 1); } catch (Exception e) { Console.WriteLine(e); return(true); } return(true); }
private async void Get_Data_User() { try { if (ListUtils.MyChannelList.Count == 0) { await ApiRequest.GetChannelData(this, UserDetails.UserId); } var local = ListUtils.MyChannelList.FirstOrDefault(); if (local != null) { if (local.Gender == "male" || local.Gender == "Male") { GenderStatus = "male"; GenderIcon.Text = "Male"; } else { GenderStatus = "female"; GenderIcon.Text = "Female"; } if (!string.IsNullOrEmpty(local.Username) || local.Username != "Empty") { TxtUsername.Text = local.Username; } if (!string.IsNullOrEmpty(local.Email) || local.Email != "Empty") { TxtEmail.Text = local.Email; } if (!string.IsNullOrEmpty(local.FirstName) || local.FirstName != "Empty") { TxtFirstName.Text = local.FirstName; } if (!string.IsNullOrEmpty(local.LastName) || local.LastName != "Empty") { TxtLastName.Text = local.LastName; } if (!string.IsNullOrEmpty(local.About) || local.About != "Empty") { TxtAboutChannal.Text = local.About; } if (!string.IsNullOrEmpty(local.Facebook) || local.Facebook != "Empty") { TxtFacebook.Text = local.Facebook; } if (!string.IsNullOrEmpty(local.Google) || local.Google != "Empty") { TxtGoogle.Text = local.Google; } if (!string.IsNullOrEmpty(local.Twitter) || local.Twitter != "Empty") { TxtTwitter.Text = local.Twitter; } if (local.FavCategory.Count > 0) { CategorySelect = local.FavCategory; foreach (var t in local.FavCategory) { CategoryId += t + ","; CategoryName += CategoriesController.ListCategories.FirstOrDefault(q => q.Id == t)?.Name + ","; } TxtFavCategory.Text = CategoryName.Remove(CategoryName.Length - 1, 1); } } } catch (Exception exception) { Console.WriteLine(exception); } }