public async Task Filter(string Title) { try { var threadSearch = await _threadService.Post <IList <ThreadModel> >(new ThreadSearchRequest { Title = Title }, "search"); ThreadsList.Clear(); foreach (var item in threadSearch) { ThreadsList.Add(item); item.Comments = new ObservableCollection <CommentDto>(); var comments = await _commentsService.Get <IList <CommentDto> >(null, $"threads/{item.Id}"); comments.ForEach(x => { item.Comments.Add(x); }); } } catch (Exception) { throw; } }
private void ShowThreadsImplementation(object o) { try { ThreadsList tl = new ThreadsList(Process.GetProcessById(SelectedTask.Id)); tl.Show(); } catch (ArgumentException) { } }
private void PriorityDown_Click(object sender, EventArgs e) { if (ThreadsList.SelectedIndex == -1) { return; } if (threads[ThreadsList.SelectedIndex].Priority != ThreadPriority.Lowest) { threads[ThreadsList.SelectedIndex].Priority--; } ThreadsList.SetSelected(ThreadsList.SelectedIndex, true); }
public void runExamples() { ThreadsList tl = new ThreadsList(); // todo: uncomment this and check the execution //tl.runExample(); ThreadCreation tc = new ThreadCreation(); // todo: uncomment this and check the execution //tc.runExample(); ThreadsJoin tj = new ThreadsJoin(2000); // todo: uncomment this and check the execution //tj.runExample(); }
// Internal private void LoadFromXmlDocument(XmlNode doc) { var xe = doc.FirstChild; if (xe == null || xe.Name != XmlConstants.RootTag) { throw new BadXmlException(); } foreach (XmlElement child in xe.ChildNodes) { var thread = ThreadModel.FromXmlElement(child); ThreadsList.Add(thread); } IsSaved = true; }
public async Task Init() { try { ThreadsList.Clear(); IList <ThreadModel> posts = null; posts = await _threadService.Get <IList <ThreadModel> >(); foreach (var item in posts) { var data = await _commentsService.Get <IList <CommentDto> >(null, $"threads/{item.Id}"); item.Comments = new ObservableCollection <CommentDto>(data); ThreadsList.Add(item); } } catch { throw; } }