public void PrintRequestUpdated(int request_id) { var requestindex = requestList.FindIndex(x => x.ID == request_id); if (requestindex == -1) { return; } var r = App.Server.GetPrintRequest(request_id); if (r == null) { return; } if (r.ContestID != contestID) { return; } var item = new PrintRequestListItem { ID = r.ID, Copies = r.Copies, Content = r.Content, Time = r.Time, Status = r.Status, UserNickName = r.UserNickName }; Dispatcher.Invoke(new Action(() => { requestList[requestindex] = item; PrintRequestListBox.Items.Refresh(); })); }
public void NewPrintRequest(int request_id) { var r = App.Server.GetPrintRequest(request_id); var item = new PrintRequestListItem { ID = r.ID, Copies = r.Copies, Content = r.Content, Time = r.Time, Status = r.Status, UserNickName = r.UserNickName }; Dispatcher.Invoke(new Action(() => { requestList.Add(item); PrintRequestListBox.Items.Refresh(); })); }
public void PrintRequestUpdated(int request_id) { var requestindex = requestList.FindIndex(x => x.ID == request_id); if (requestindex == -1) return; var r = App.Server.GetPrintRequest(request_id); if (r == null) return; if (r.ContestID != contestID) return; var item = new PrintRequestListItem { ID = r.ID, Copies = r.Copies, Content = r.Content, Time = r.Time, Status = r.Status, UserNickName = r.UserNickName }; Dispatcher.Invoke(new Action(() => { requestList[requestindex] = item; PrintRequestListBox.Items.Refresh(); })); }