public UINominationSelectContainer(NhoodCandidateList candidates, bool nonPerson) { NonPerson = nonPerson; var ui = RenderScript("fsodonatorlist.uis"); var listBg = ui.Create <UIImage>("ListBoxBackground"); AddAt(0, listBg); listBg.With9Slice(25, 25, 25, 25); listBg.Width += 110; listBg.Height += 50; RoommateListSlider.AttachButtons(RoommateListScrollUpButton, RoommateScrollDownButton, 1); RoommateListBox.AttachSlider(RoommateListSlider); RoommateListBox.Columns[1].Alignment = Framework.TextAlignment.Left | Framework.TextAlignment.Middle; DonatorsLabel.Caption = "Search"; DonatorsLabel.CaptionStyle = DonatorsLabel.CaptionStyle.Clone(); DonatorsLabel.CaptionStyle.Shadow = true; DonatorsLabel.Y -= 26; foreach (var child in GetChildren()) { child.Y -= 45; } SearchBox = new UITextBox(); SearchBox.X = RoommateListBox.X; SearchBox.Y = 20; SearchBox.SetSize(listBg.Width, 25); SearchBox.OnChange += SearchBox_OnChange; Add(SearchBox); Candidates = candidates; UpdateCandidateList(candidates); }
public void UpdateCandidateList(NhoodCandidateList candidates) { IEnumerable <NhoodCandidate> sims = candidates.Candidates; var searchString = SearchBox.CurrentText.ToLowerInvariant(); if (SearchBox.CurrentText != "") { sims = sims.Where(x => x.Name.ToLowerInvariant().Contains(searchString)); } RoommateListBox.Items = sims.OrderBy(x => x.Name).Select(x => { var personBtn = new UIPersonButton() { AvatarId = x.ID, FrameSize = UIPersonButtonSize.SMALL }; personBtn.LogicalParent = this; UIRatingDisplay rating = null; if (x.Rating != uint.MaxValue) { rating = new UIRatingDisplay(true); rating.LogicalParent = this; rating.DisplayStars = x.Rating / 100f; rating.LinkAvatar = x.ID; } return(new UIListBoxItem( x, personBtn, x.Name, "", (object)rating ?? "" )); }).ToList(); }
public UIVoteContainer(NhoodCandidateList cand) { Candidates = cand; Init(cand.Candidates.Count); for (int i = 0; i < Elems.Count; i++) { Elems[i].ShowCandidate(cand.Candidates[i]); } }
public void MessageReceived(AriesClient client, object message) { if (message is T || message is T2) { AsyncProcessMessage(message); } else if (message is NhoodCandidateList) { CandidateList = (NhoodCandidateList)message; } }
public UINominationSelectContainer(NhoodCandidateList candidates) { var ui = RenderScript("fsodonatorlist.uis"); var listBg = ui.Create <UIImage>("ListBoxBackground"); AddAt(0, listBg); listBg.With9Slice(25, 25, 25, 25); listBg.Width += 110; listBg.Height += 50; /* * Dropdown = ui.Create<UIInboxDropdown>("PullDownMenuSetup"); * Dropdown.OnSearch += (query) => * { * FindController<GenericSearchController>()?.Search(query, false, (results) => * { * Dropdown.SetResults(results); * }); * }; * Dropdown.OnSelect += AddDonator; * Add(Dropdown);*/ RoommateListSlider.AttachButtons(RoommateListScrollUpButton, RoommateScrollDownButton, 1); RoommateListBox.AttachSlider(RoommateListSlider); RoommateListBox.Columns[1].Alignment = Framework.TextAlignment.Left | Framework.TextAlignment.Middle; DonatorsLabel.Caption = "Search"; DonatorsLabel.CaptionStyle = DonatorsLabel.CaptionStyle.Clone(); DonatorsLabel.CaptionStyle.Shadow = true; DonatorsLabel.Y -= 26; foreach (var child in GetChildren()) { child.Y -= 45; } SearchBox = new UITextBox(); SearchBox.X = RoommateListBox.X; SearchBox.Y = 20; SearchBox.SetSize(listBg.Width, 25); SearchBox.OnChange += SearchBox_OnChange; Add(SearchBox); Candidates = candidates; UpdateCandidateList(candidates); }
public UINominationSelectContainer(NhoodCandidateList candidates) : this(candidates, false) { }