Cleanup and comment

This commit is contained in:
Milan Hanajik 2021-03-01 21:33:54 +01:00
parent 35815fe78a
commit 8dc45484b0
2 changed files with 17 additions and 11 deletions

View File

@ -65,17 +65,17 @@ namespace TBF.UI.Bench.Components
if (ComponentCfgCtrl != null)
{
splitContainer.Panel1.Controls.Add((UserControl)ComponentCfgCtrl);
}
if ((ComponentCfgCtrl != null) && ComponentCfgCtrl.ShowMore)
{
sharedButtons.OptionalButtons = SharedButtons.Buttons.More;
}
if (ComponentCfgCtrl.ShowMore)
{
sharedButtons.OptionalButtons = SharedButtons.Buttons.More;
}
if (UnlockAfterStart)
{
sharedButtons.UnlockButtons();
ComponentCfgCtrl.Unlock();
if (UnlockAfterStart)
{
sharedButtons.UnlockButtons();
ComponentCfgCtrl.Unlock();
}
}
}

View File

@ -414,7 +414,10 @@ namespace TBF.UI.Bench.Components
IComponentCfg cfg = factory.DefaultConfig();
if (selectComponentTypeDlg.SelectedScriptName == null)
{
IComponentCfgCtrl cfgControl = cfg.GetControl();
///
/// Create a single component of the selected type
///
IComponentCfgCtrl cfgControl = cfg.GetControl();
cfgControl.Config = cfg;
cfgControl.Config.ItemNr = (cmpntEntities.Count > 0) ? (cmpntEntities[cmpntEntities.Count - 1].ItemNr + 1) : 1;
@ -430,7 +433,10 @@ namespace TBF.UI.Bench.Components
}
else
{
using (TextReader reader = new StreamReader(selectComponentTypeDlg.SelectedScriptName))
///
/// Create more components, read their names and other properties from a file
///
using (TextReader reader = new StreamReader(selectComponentTypeDlg.SelectedScriptName))
{
int zeroBasedIdx = 0;
string line = reader.ReadLine();