ISimulatorNode CreateMaster(ISimulatorNodeCallbacks callbacks)
{
using (var dialog = new Components.MasterDialog())
{
dialog.ShowDialog();
if (dialog.DialogResult == DialogResult.OK)
{
var cache = new MeasurementCache();
var masterConfig = dialog.Configuration;
var alias = dialog.SelectedAlias;
var master = channel.AddMaster(alias, cache, DefaultMasterApplication.Instance, masterConfig);
if (master == null)
{
return null;
}
else
{
master.Enable();
return new MasterNode(cache, master, callbacks, alias);
}
}
else
{
return null;
}
}
}