2015-07-01 23:17:14 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
2015-07-03 00:12:02 -04:00
|
|
|
|
using Mesen.GUI.Config;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Forms.NetPlay
|
|
|
|
|
{
|
|
|
|
|
public partial class frmClientConfig : BaseConfigForm
|
|
|
|
|
{
|
|
|
|
|
public frmClientConfig()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
2016-02-06 15:33:45 -05:00
|
|
|
|
Entity = ConfigManager.Config.ClientConnectionInfo;
|
|
|
|
|
|
|
|
|
|
AddBinding("Host", this.txtHost);
|
2018-06-16 14:02:12 -04:00
|
|
|
|
AddBinding("Password", this.txtPassword);
|
2016-02-06 15:33:45 -05:00
|
|
|
|
AddBinding("Spectator", chkSpectator);
|
2015-07-01 23:17:14 -04:00
|
|
|
|
this.txtPort.Text = ConfigManager.Config.ClientConnectionInfo.Port.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateConfig()
|
|
|
|
|
{
|
2016-02-06 15:33:45 -05:00
|
|
|
|
((ClientConnectionInfo)Entity).Port = Convert.ToUInt16(this.txtPort.Text);
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Field_TextChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
UInt16 port;
|
|
|
|
|
if(!UInt16.TryParse(this.txtPort.Text, out port)) {
|
|
|
|
|
this.btnOK.Enabled = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.btnOK.Enabled = !string.IsNullOrWhiteSpace(this.txtHost.Text);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|