Inheritance: System.Windows.Forms.Form
Beispiel #1
0
        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);
                }
            }
        }
        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;
                }
            }
        }