| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Windows.Controls;
- using Comal.Classes;
- using InABox.Core;
- using InABox.DynamicGrid;
- namespace PRSDesktop;
- public partial class JobScopePanel : UserControl, IPanel<JobScope>, IJobControl
- {
- public JobScopePanel()
- {
- InitializeComponent();
-
- }
-
- public Job Job
- {
- get => _scopes.Job;
- set
- {
- _scopes.Job = value;
- }
- }
- public JobPanelSettings Settings { get; set; }
- public bool IsReady { get; set; }
- public event DataModelUpdateEvent OnUpdateDataModel;
- public void CreateToolbarButtons(IPanelHost host)
- {
- }
- public void Setup()
- {
- _scopes.Refresh(true, false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
- public void Refresh()
- {
- _scopes.Refresh(false, true);
- }
- public string SectionName => "Job Scopes";
- public DataModel DataModel(Selection selection)
- {
- var ids = _scopes.ExtractValues(x => x.ID, selection).ToArray();
- return new AutoDataModel<JobScope>(new Filter<JobScope>(c => c.ID).InList(ids));
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- private void _scopes_OnSelectItem(object sender, DynamicGridSelectionEventArgs e)
- {
- var row = e.Rows?.FirstOrDefault()?.ToObject<JobScope>();
- // Populate the sub-grids with the scope summaries
- }
- }
|