示例#1
0
            // 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;
            }
示例#2
0
        /// <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;
        }
示例#3
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();
                }
            }
        }
示例#4
0
        /// <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();
            }
        }
示例#5
0
 public OptionsForm(Options o)
 {
     InitializeComponent();
     _o = new Options(o);             // copy ctor
 }
示例#6
0
 public OptionsForm()
 {
     InitializeComponent();
     _o = new Options();             // defaults
 }