-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIpConnectWizardWindow.xaml.cs
More file actions
39 lines (33 loc) · 1.68 KB
/
Copy pathIpConnectWizardWindow.xaml.cs
File metadata and controls
39 lines (33 loc) · 1.68 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
using System.Windows;
namespace Ari61850Bridge;
public partial class IpConnectWizardWindow : Window
{
public static readonly DependencyProperty RelayIpAddressProperty = DependencyProperty.Register(nameof(RelayIpAddress), typeof(string), typeof(IpConnectWizardWindow), new PropertyMetadata(string.Empty));
public static readonly DependencyProperty MmsPortProperty = DependencyProperty.Register(nameof(MmsPort), typeof(int), typeof(IpConnectWizardWindow), new PropertyMetadata(102));
public static readonly DependencyProperty UseNativeIecEngineProperty = DependencyProperty.Register(nameof(UseNativeIecEngine), typeof(bool), typeof(IpConnectWizardWindow), new PropertyMetadata(true));
public string RelayIpAddress { get => (string)GetValue(RelayIpAddressProperty); set => SetValue(RelayIpAddressProperty, value); }
public int MmsPort { get => (int)GetValue(MmsPortProperty); set => SetValue(MmsPortProperty, value); }
public bool UseNativeIecEngine { get => (bool)GetValue(UseNativeIecEngineProperty); set => SetValue(UseNativeIecEngineProperty, value); }
public IpConnectWizardWindow()
{
InitializeComponent();
Loaded += (_, _) => RelayIpBox.Focus();
}
private void Connect_Click(object sender, RoutedEventArgs e)
{
RelayIpAddress = (RelayIpAddress ?? string.Empty).Trim();
if (string.IsNullOrWhiteSpace(RelayIpAddress))
{
WizardStatusText.Text = "Enter the IED IP address.";
RelayIpBox.Focus();
return;
}
DialogResult = true;
Close();
}
private void Cancel_Click(object sender, RoutedEventArgs e)
{
DialogResult = false;
Close();
}
}