Mesen-X/GUI.NET/Forms/NetPlay/frmClientConfig.cs
Souryo 48409ae82b -Rewrote entire GUI in .NET
-Several other fixes (bugfixes, refactoring, etc.)
-Added a few more features to debugger
2015-07-01 23:17:14 -04:00

39 lines
1 KiB
C#

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;
namespace Mesen.GUI.Forms.NetPlay
{
public partial class frmClientConfig : BaseConfigForm
{
public frmClientConfig()
{
InitializeComponent();
this.txtHost.Text = ConfigManager.Config.ClientConnectionInfo.Host;
this.txtPort.Text = ConfigManager.Config.ClientConnectionInfo.Port.ToString();
}
protected override void UpdateConfig()
{
ConfigManager.Config.ClientConnectionInfo = new ClientConnectionInfo() { Host = this.txtHost.Text, Port = Convert.ToUInt16(this.txtPort.Text) };
}
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);
}
}
}
}