void BtnAccept_Click(object sender, EventArgs e)
{
if (ValidatePropertiesForm())
{
SetSelectedInstrument();
if (Instruments.InstrumentList.ContainsKey(instrPropSelectedInstrument.Symbol))
{ // The instrument exists. We change it.
Instruments.InstrumentList[instrPropSelectedInstrument.Symbol] = instrPropSelectedInstrument.Clone();
}
else
{ // The instrument doesn't exist. We create it.
Instruments.InstrumentList.Add(instrPropSelectedInstrument.Symbol, instrPropSelectedInstrument.Clone());
lbxInstruments.Items.Add(instrPropSelectedInstrument.Symbol);
bNeedReset = true;
}
}
return;
}