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, 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(new Filter(c => c.ID).InList(ids)); } public Dictionary Selected() { return new Dictionary(); } public void Heartbeat(TimeSpan time) { } private void _scopes_OnSelectItem(object sender, DynamicGridSelectionEventArgs e) { var row = e.Rows?.FirstOrDefault()?.ToObject(); // Populate the sub-grids with the scope summaries } }