JobAssignmentPanel.xaml.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Controls;
  5. using Comal.Classes;
  6. using System.ComponentModel;
  7. using System.ComponentModel;
  8. using InABox.Core;
  9. namespace PRSDesktop
  10. {
  11. public partial class JobAssignmentPanel : UserControl, IBasePanel, IJobControl, IDataModelSource
  12. {
  13. public JobAssignmentPanel()
  14. {
  15. InitializeComponent();
  16. }
  17. #region IJobPanel
  18. public Job Job
  19. {
  20. get => Activities.Job;
  21. set
  22. {
  23. Activities.Job = value;
  24. Assignments.Job = value;
  25. }
  26. }
  27. public JobPanelSettings Settings { get; set; }
  28. #endregion
  29. #region IDataModelSource
  30. public event DataModelUpdateEvent OnUpdateDataModel;
  31. public string SectionName => "Job Assignments";
  32. public DataModel DataModel(Selection selection)
  33. {
  34. var ids = Assignments.ExtractValues(x => x.ID, selection).ToArray();
  35. return new AssignmentDataModel(new Filter<Assignment>(x => x.ID).InList(ids));
  36. }
  37. #endregion
  38. #region IBasePanel
  39. public void Setup()
  40. {
  41. Activities.Refresh(true, false);
  42. Assignments.Refresh(true, false);
  43. }
  44. public void Shutdown(CancelEventArgs? cancel)
  45. {
  46. }
  47. public void Refresh()
  48. {
  49. Activities.Refresh(false, true);
  50. Assignments.Refresh(false, true);
  51. }
  52. public bool IsReady { get; set; }
  53. public void CreateToolbarButtons(IPanelHost host)
  54. {
  55. }
  56. public Dictionary<string, object[]> Selected()
  57. {
  58. return new Dictionary<string, object[]>();
  59. }
  60. public void Heartbeat(TimeSpan time)
  61. {
  62. }
  63. #endregion
  64. }
  65. }