| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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
- {
- /// <summary>
- /// Interaction logic for JobDesigns.xaml
- /// </summary>
- public partial class JobDesignList : UserControl, IPanel<Setout>, IJobControl
- {
- public JobDesignList()
- {
- InitializeComponent();
- Designs.OnSelectItem += Designs_OnSelectItem;
- }
- public Job Job { get; set; }
-
- public JobPanelSettings Settings { get; set; }
- public bool IsReady { get; set; }
- public event DataModelUpdateEvent OnUpdateDataModel;
- public void CreateToolbarButtons(IPanelHost host)
- {
- }
- public string SectionName => "Job Designs";
- public DataModel DataModel(Selection selection)
- {
- var ids = Designs.ExtractValues(c => c.ID, selection).ToArray();
- return new BaseDataModel<Setout>(new Filter<Setout>(x => x.ID).InList(ids));
- }
- public void Refresh()
- {
- Designs.Job = Job;
- Designs.Refresh(false, true);
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- public void Setup()
- {
- Designs.Refresh(true, false);
- Documents.Refresh(true, false);
- Packets.Refresh(true, false);
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- private void Designs_OnSelectItem(object sender, DynamicGridSelectionEventArgs e)
- {
- var design = e.Rows?.FirstOrDefault()?.ToObject<Setout>() ?? new Setout();
- Documents.Design = design;
- Documents.Refresh(true, true);
- Packets.Job = Job;
- Packets.Design = design;
- Packets.Refresh(true, true);
- }
- }
- }
|