-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImportSettings.cs
101 lines (86 loc) · 2.5 KB
/
ImportSettings.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Gurux.Common;
using Gurux.Device;
using GXDLMS.ManufacturerSettings;
using Gurux.DLMS.ManufacturerSettings;
namespace Gurux.DLMS.AddIn
{
public partial class ImportSettings : Form, IGXWizardPage
{
GXDLMSDevice m_device;
public ImportSettings(GXDevice device)
{
InitializeComponent();
m_device = device as GXDLMSDevice;
PasswordTB.ReadOnly = m_device.Authentication == Gurux.DLMS.Authentication.None;
SerialNumberTB.ReadOnly = m_device.HDLCAddressing != HDLCAddressType.SerialNumber;
PasswordTB.Text = m_device.Password;
SerialNumberTB.Text = m_device.SerialNumber;
}
#region IGXWizardPage Members
bool IGXWizardPage.IsShown()
{
return m_device.StartProtocol == StartProtocolType.IEC || m_device.Authentication != Authentication.None;
}
void IGXWizardPage.Next()
{
if (m_device.Authentication != Gurux.DLMS.Authentication.None)
{
m_device.Password = PasswordTB.Text;
}
if (m_device.HDLCAddressing == HDLCAddressType.SerialNumber)
{
m_device.SerialNumber = SerialNumberTB.Text;
if (SerialNumberTB.Text.Length == 0)
{
throw new Exception("Invalid Serial Number.");
}
}
}
void IGXWizardPage.Back()
{
}
void IGXWizardPage.Finish()
{
}
void IGXWizardPage.Cancel()
{
}
void IGXWizardPage.Initialize()
{
}
GXWizardButtons IGXWizardPage.EnabledButtons
{
get
{
return GXWizardButtons.All;
}
}
string IGXWizardPage.Caption
{
get
{
return "";
}
}
string IGXWizardPage.Description
{
get
{
return "";
}
}
object IGXWizardPage.Target
{
get;
set;
}
#endregion
}
}