-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathNewOrEditCredentialDialog.xaml.cs
45 lines (38 loc) · 1.19 KB
/
NewOrEditCredentialDialog.xaml.cs
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
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using AutomationISE.Model;
namespace AutomationISE
{
/// <summary>
/// Interaction logic for NewOrEditCredentialDialog.xaml
/// </summary>
public partial class NewOrEditCredentialDialog : Window
{
private string _username;
private string _password;
public string username { get { return _username; } }
public string password { get { return _password; } }
public NewOrEditCredentialDialog(AutomationCredential cred)
{
InitializeComponent();
if (cred != null)
{
UsernameTextbox.Text = cred.getUsername();
PasswordTextbox.Password = cred.getPassword();
this.Title = "Edit Credential Asset";
}
else
{
this.Title = "New Credential Asset";
}
}
private void OkButton_Click(object sender, RoutedEventArgs e)
{
_username = UsernameTextbox.Text;
_password = PasswordTextbox.Password;
this.DialogResult = true;
}
}
}