示例#1
0
        /// <summary>
        /// Raises GazepointSettingDialog to change the settings
        /// for this interface.
        /// </summary>
        public override void ChangeSettings()
        {
            var dlg = new GazepointSettingsDialog {
                GazepointSetting = this.memSettings
            };
            string prevAdd  = this.memSettings.ServerAddress;
            int    prevPort = this.memSettings.ServerPort;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                // If settings has changed, and we where connected, we need to disconnect
                if (!prevAdd.Equals(this.memSettings.ServerAddress) ||
                    !prevPort.Equals(this.memSettings.ServerPort))
                {
                    this.CleanUp();
                    this.memNetworkManager.ChangePort(this.memConnectionsIds[0], dlg.GazepointSetting.ServerPort);
                    this.memNetworkManager.ChangeAddress(this.memConnectionsIds[0], dlg.GazepointSetting.ServerAddress);
                }

                this.memSettings = dlg.GazepointSetting;
                this.SerializeSettings(this.Settings, this.SettingsFile);
            }
        }
示例#2
0
    /// <summary>
    /// Raises GazepointSettingDialog to change the settings
    /// for this interface.
    /// </summary>
    public override void ChangeSettings()
    {
      var dlg = new GazepointSettingsDialog { GazepointSetting = this.memSettings };
      string prevAdd = this.memSettings.ServerAddress;
      int prevPort = this.memSettings.ServerPort;
      if (dlg.ShowDialog() == DialogResult.OK)
      {
        // If settings has changed, and we where connected, we need to disconnect
        if (!prevAdd.Equals(this.memSettings.ServerAddress) ||
            !prevPort.Equals(this.memSettings.ServerPort))
        {
          this.CleanUp();
          this.memNetworkManager.ChangePort(this.memConnectionsIds[0], dlg.GazepointSetting.ServerPort);
          this.memNetworkManager.ChangeAddress(this.memConnectionsIds[0], dlg.GazepointSetting.ServerAddress);
        }

        this.memSettings = dlg.GazepointSetting;
        this.SerializeSettings(this.Settings, this.SettingsFile);
      }
    }