-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathAccountDialog.xaml.cs
More file actions
67 lines (55 loc) · 1.49 KB
/
AccountDialog.xaml.cs
File metadata and controls
67 lines (55 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using Windows.UI.Xaml.Controls;
// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace ActuatorXmpp
{
public sealed partial class AccountDialog : ContentDialog
{
private string host = string.Empty;
private int port = 5222;
private string userName = string.Empty;
private string password = string.Empty;
public AccountDialog(string Host, int Port, string UserName)
{
this.host = Host;
this.port = Port;
this.userName = UserName;
this.InitializeComponent();
this.HostInput.Text = Host;
this.PortInput.Text = Port.ToString();
this.UserNameInput.Text = UserName;
}
public string Host
{
get { return this.host; }
set { this.host = value; }
}
public int Port
{
get { return this.port; }
set { this.port = value; }
}
public string UserName
{
get { return this.userName; }
set { this.userName = value; }
}
public string Password
{
get { return this.password; }
set { this.password = value; }
}
private void ContentDialog_ConnectButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
if (ushort.TryParse(this.PortInput.Text, out ushort Port))
this.port = Port;
else
args.Cancel = true;
this.host = this.HostInput.Text;
this.userName = this.UserNameInput.Text;
this.password = this.PasswordInput.Password;
}
private void ContentDialog_CancelButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}
}
}