private void activeSortWithParameters() { UserAnalysis.eStarsParameters chosenParams = sortParametersPicked(); if (chosenParams != UserAnalysis.eStarsParameters.None) { try { foreach (PictureTopBar item in r_PictureTopBars) { item.MyUserAnalysis.ClacStarsFromAnalisis(chosenParams); } r_PictureTopBars.Sort(new PictureTopBarStarSort()); flowLayoutPanelFriends.Invoke(new Action(() => flowLayoutPanelFriends.Controls.Clear())); foreach (PictureTopBar item in r_PictureTopBars) { item.Invoke(new Action(() => item.LabelText.Text = string.Format("{0} Gold ,{1} normal stars" , item.MyUserAnalysis.MyStars.GoldenStars, item.MyUserAnalysis.MyStars.NormalStars))); flowLayoutPanelFriends.Invoke(new Action(() => flowLayoutPanelFriends.Controls.Add(item))); } } catch (Exception) { serviceNotAvailableMessage(); } } }
private UserAnalysis.eStarsParameters sortParametersPicked() { UserAnalysis.eStarsParameters chosenParams = UserAnalysis.eStarsParameters.None; if (checkBoxCheckin.Checked == true) { chosenParams |= UserAnalysis.eStarsParameters.Checkin; } if (checkBoxCheckin.Checked == true) { chosenParams |= UserAnalysis.eStarsParameters.Posts; } if (checkBoxCheckin.Checked == true) { chosenParams |= UserAnalysis.eStarsParameters.Events; } if (checkBoxCheckin.Checked == true) { chosenParams |= UserAnalysis.eStarsParameters.Tagged; } return(chosenParams); }