// copy constructor public Options(OptionsForm.Options toCopy) { NoPunctuation = toCopy.NoPunctuation; NoNumbers = toCopy.NoNumbers; NoCapitals = toCopy.NoCapitals; NoEnter = toCopy.NoEnter; NoBackspace = toCopy.NoBackspace; NoWordBackspace = toCopy.NoWordBackspace; AutoStop = toCopy.AutoStop; StopAfter = toCopy.StopAfter; AutoQuit = toCopy.AutoQuit; AutoSwitch = toCopy.AutoSwitch; SwitchAfter = toCopy.SwitchAfter; ReceiveOnNet = toCopy.ReceiveOnNet; UseWebSockets = toCopy.UseWebSockets; ReceivePort = toCopy.ReceivePort; ReceiveIP = toCopy.ReceiveIP; Echo = toCopy.Echo; SendPres = toCopy.SendPres; SendOnTcp = toCopy.SendOnTcp; SendPort = toCopy.SendPort; SendIP = toCopy.SendIP; }
/// <summary> /// The constructor for the main TextTest form. /// </summary> public MainForm() { InitializeComponent(); SetControlHeights(this.Font); SetMinFormHeight(); _o = new OptionsForm.Options(); // default options _phrases = new Phrases(); _fileNoExt = String.Empty; _bkspSelLength = 0; }
/// <summary> /// Shows the options for this application. The OptionsForm defines what /// options are available, and exports them in a public structure. /// </summary> /// <param name="sender">The sender of this event.</param> /// <param name="e">The arguments for this event.</param> private void mniTestOptions_Click(object sender, EventArgs e) { OptionsForm dlg = new OptionsForm(_o); if (dlg.ShowDialog(this) == DialogResult.OK) { // stop any sending or listening if (_sender != null && _sender.IsConnected) { _sender.Disconnect(); } if (_listener != null && _listener.IsListening) { _listener.Stop(); } // set our options reference _o = dlg.Settings; // potentially start receiving as a network server if (_o.ReceiveOnNet) { if (_o.UseWebSockets) { _listener = new WebSocketListener(this); // ws } else { _listener = new NetListener(this); // tcp } _listener.NetDataEvent += new NetListener.NetEventHandler(OnNetworkDataReceived); _listener.IP = _o.ReceiveIP; _listener.Port = _o.ReceivePort; _listener.Start(); } // potentially start sending as a network client if (_o.SendOnTcp) { _sender = new NetSender(); _sender.IP = _o.SendIP; _sender.Port = _o.SendPort; _sender.Connect(); } } }
/// <summary> /// The constructor for the main TextTest form. /// </summary> public MainForm() { InitializeComponent(); SetControlHeights(this.Font); SetMinFormHeight(); _o = new OptionsForm.Options(); // default options _phrases = new Phrases(); //_fileNoExt = String.Empty; _bkspSelLength = 0; // read participant numbering using (ParticipantNumbering participantNumbering = new ParticipantNumbering()) { _fileNoExt = (participantNumbering.ParticipantNumber).ToString(); } }
public OptionsForm(Options o) { InitializeComponent(); _o = new Options(o); // copy ctor }
public OptionsForm() { InitializeComponent(); _o = new Options(); // defaults }