123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- 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 Guid ParentID { 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.ParentID = ParentID;
- 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()
- {
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- private void Designs_OnSelectItem(object sender, DynamicGridSelectionEventArgs e)
- {
- var row = e.Rows?.FirstOrDefault();
- var id = row != null ? row.Get<Setout, Guid>(x => x.ID) : CoreUtils.FullGuid;
- Documents.SetoutID = id;
- Documents.Refresh(true, true);
- Packets.ParentID = ParentID;
- Packets.SetoutID = id;
- Packets.Refresh(true, true);
- }
- }
- }
|