-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
SqlServerPage.vb
68 lines (58 loc) · 2.72 KB
/
SqlServerPage.vb
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
Imports mRemoteNG.My
Imports mRemoteNG.App
Imports mRemoteNG.App.Info
Imports mRemoteNG.Security
Namespace Forms.OptionsPages
Public Class SqlServerPage
Public Overrides Property PageName() As String
Get
Return Language.strSQLServer.TrimEnd(":")
End Get
Set(value As String)
End Set
End Property
Public Overrides Sub ApplyLanguage()
MyBase.ApplyLanguage()
lblExperimental.Text = Language.strExperimental.ToUpper
lblSQLInfo.Text = Language.strSQLInfo
chkUseSQLServer.Text = Language.strUseSQLServer
lblSQLServer.Text = Language.strLabelHostname
lblSQLDatabaseName.Text = Language.strLabelSQLServerDatabaseName
lblSQLUsername.Text = Language.strLabelUsername
lblSQLPassword.Text = Language.strLabelPassword
End Sub
Public Overrides Sub LoadSettings()
MyBase.SaveSettings()
chkUseSQLServer.Checked = My.Settings.UseSQLServer
txtSQLServer.Text = My.Settings.SQLHost
txtSQLDatabaseName.Text = My.Settings.SQLDatabaseName
txtSQLUsername.Text = My.Settings.SQLUser
txtSQLPassword.Text = Crypt.Decrypt(My.Settings.SQLPass, General.EncryptionKey)
End Sub
Public Overrides Sub SaveSettings()
MyBase.SaveSettings()
My.Settings.UseSQLServer = chkUseSQLServer.Checked
My.Settings.SQLHost = txtSQLServer.Text
My.Settings.SQLDatabaseName = txtSQLDatabaseName.Text
My.Settings.SQLUser = txtSQLUsername.Text
My.Settings.SQLPass = Crypt.Encrypt(txtSQLPassword.Text, General.EncryptionKey)
Runtime.Startup.DestroySQLUpdateHandlerAndStopTimer()
If My.Settings.UseSQLServer Then
Runtime.SetMainFormText("SQL Server")
Runtime.Startup.CreateSQLUpdateHandlerAndStartTimer()
Else
Runtime.SetMainFormText(Runtime.GetStartupConnectionFileName())
End If
End Sub
Private Sub chkUseSQLServer_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles chkUseSQLServer.CheckedChanged
lblSQLServer.Enabled = chkUseSQLServer.Checked
lblSQLDatabaseName.Enabled = chkUseSQLServer.Checked
lblSQLUsername.Enabled = chkUseSQLServer.Checked
lblSQLPassword.Enabled = chkUseSQLServer.Checked
txtSQLServer.Enabled = chkUseSQLServer.Checked
txtSQLDatabaseName.Enabled = chkUseSQLServer.Checked
txtSQLUsername.Enabled = chkUseSQLServer.Checked
txtSQLPassword.Enabled = chkUseSQLServer.Checked
End Sub
End Class
End Namespace