Skip to content

Commit 3c8dbd2

Browse files
committed
Add PropertyGrid to NeuropixelsV1 dialogs
1 parent df82c4c commit 3c8dbd2

File tree

3 files changed

+161
-86
lines changed

3 files changed

+161
-86
lines changed

OpenEphys.Onix1.Design/NeuropixelsV1Dialog.cs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public partial class NeuropixelsV1Dialog : Form
1414
/// Public <see cref="IConfigureNeuropixelsV1"/> interface that is manipulated by
1515
/// <see cref="NeuropixelsV1Dialog"/>.
1616
/// </summary>
17-
public IConfigureNeuropixelsV1 ConfigureNode { get; set; }
17+
public IConfigureNeuropixelsV1 ConfigureNode
18+
{
19+
get => (IConfigureNeuropixelsV1)ProbeConfigurationDialog.propertyGrid.SelectedObject;
20+
set => ProbeConfigurationDialog.propertyGrid.SelectedObject = value;
21+
}
1822

1923
/// <summary>
2024
/// Initializes a new instance of <see cref="NeuropixelsV1Dialog"/>.
@@ -25,24 +29,8 @@ public NeuropixelsV1Dialog(IConfigureNeuropixelsV1 configureNode)
2529
InitializeComponent();
2630
Shown += FormShown;
2731

28-
if (configureNode is ConfigureNeuropixelsV1e configureV1e)
29-
{
30-
ConfigureNode = new ConfigureNeuropixelsV1e(configureV1e);
31-
}
32-
else if (configureNode is ConfigureNeuropixelsV1f configureV1f)
33-
{
34-
ConfigureNode = new ConfigureNeuropixelsV1f(configureV1f);
35-
}
36-
37-
ProbeConfigurationDialog = new(ConfigureNode.ProbeConfiguration, ConfigureNode.AdcCalibrationFile, ConfigureNode.GainCalibrationFile, ConfigureNode.InvertPolarity)
38-
{
39-
TopLevel = false,
40-
FormBorderStyle = FormBorderStyle.None,
41-
Dock = DockStyle.Fill,
42-
Parent = this
43-
};
44-
45-
panelProbe.Controls.Add(ProbeConfigurationDialog);
32+
ProbeConfigurationDialog = new(configureNode);
33+
ProbeConfigurationDialog.SetChildFormProperties(this).AddDialogToPanel(panelProbe);
4634

4735
this.AddMenuItemsFromDialogToFileOption(ProbeConfigurationDialog);
4836
}

0 commit comments

Comments
 (0)