|
|
@@ -147,6 +147,10 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
|
|
|
}
|
|
|
private void EnsureScript()
|
|
|
{
|
|
|
+ if(_script is not null && _script.Text != _settings.Script)
|
|
|
+ {
|
|
|
+ _script = null;
|
|
|
+ }
|
|
|
if (_script is null && !_settings.Script.IsNullOrWhiteSpace())
|
|
|
{
|
|
|
_script = new ScriptDocument(_settings.Script);
|
|
|
@@ -861,14 +865,7 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
|
|
|
ProjectSetupActions.SetoutGroups(host);
|
|
|
host.CreateSetupSeparator();
|
|
|
|
|
|
- host.CreateSetupAction(
|
|
|
- new PanelAction()
|
|
|
- {
|
|
|
- Caption = "Setouts Configuration",
|
|
|
- Image = PRSDesktop.Resources.specifications,
|
|
|
- OnExecute = ConfigSettingsClick
|
|
|
- }
|
|
|
- );
|
|
|
+ SetoutsConfigurationSettings(host, () => _settings);
|
|
|
host.CreateSetupAction(
|
|
|
new PanelAction()
|
|
|
{
|
|
|
@@ -905,18 +902,28 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
|
|
|
list.ShowDialog();
|
|
|
}
|
|
|
|
|
|
- private void ConfigSettingsClick(PanelAction obj)
|
|
|
+ public static void SetoutsConfigurationSettings(IPanelHost host, Func<StagingPanellSettings> getSettings)
|
|
|
+ {
|
|
|
+ host.CreateSetupAction(
|
|
|
+ new PanelAction()
|
|
|
+ {
|
|
|
+ Caption = "Setouts Configuration",
|
|
|
+ Image = PRSDesktop.Resources.specifications,
|
|
|
+ OnExecute = action => ConfigSettingsClick(getSettings())
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void ConfigSettingsClick(StagingPanellSettings settings)
|
|
|
{
|
|
|
var grid = new DynamicItemsListGrid<StagingPanellSettings>();
|
|
|
grid.OnCustomiseEditor += Grid_OnCustomiseEditor;
|
|
|
- if(grid.EditItems(new[] { _settings }))
|
|
|
+ if(grid.EditItems(new[] { settings }))
|
|
|
{
|
|
|
- new GlobalConfiguration<StagingPanellSettings>().Save(_settings);
|
|
|
- _script = null;
|
|
|
+ new GlobalConfiguration<StagingPanellSettings>().Save(settings);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void Grid_OnCustomiseEditor(IDynamicEditorForm sender, StagingPanellSettings[]? items, DynamicGridColumn column, BaseEditor editor)
|
|
|
+ private static void Grid_OnCustomiseEditor(IDynamicEditorForm sender, StagingPanellSettings[]? items, DynamicGridColumn column, BaseEditor editor)
|
|
|
{
|
|
|
if (items?.FirstOrDefault() is not StagingPanellSettings settings) return;
|
|
|
|