File: Settings.vb

package info (click to toggle)
mono-basic 2.10-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 22,964 kB
  • sloc: cs: 34,086; xml: 7,804; makefile: 471; sh: 317
file content (125 lines) | stat: -rw-r--r-- 5,299 bytes parent folder | download | duplicates (3)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
' 
' Visual Basic.Net Compiler
' Copyright (C) 2004 - 2010 Rolf Bjarne Kvinge, RKvinge@novell.com
' 
' This library is free software; you can redistribute it and/or
' modify it under the terms of the GNU Lesser General Public
' License as published by the Free Software Foundation; either
' version 2.1 of the License, or (at your option) any later version.
' 
' This library is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
' Lesser General Public License for more details.
' 
' You should have received a copy of the GNU Lesser General Public
' License along with this library; if not, write to the Free Software
' Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
' 

Namespace My

    'This class allows you to handle specific events on the settings class:
    ' The SettingChanging event is raised before a setting's value is changed.
    ' The PropertyChanged event is raised after a setting's value is changed.
    ' The SettingsLoaded event is raised after the setting values are loaded.
    ' The SettingsSaving event is raised before the setting values are saved.
    Partial Friend NotInheritable Class Settings
        Shared Property ModifyRegistry() As String
            Get
                Return GetSetting("ModifyRegistry", "N")
            End Get
            Set(ByVal value As String)
                SaveSetting("ModifyRegistry", value)
            End Set
        End Property
        Shared Property txtVBCCompiler_Text() As String
            Get
                Return GetSetting("txtVBCCompiler_Text2", "")
            End Get
            Set(ByVal value As String)
                SaveSetting("txtVBCCompiler_Text2", value)
            End Set
        End Property
        Shared Property txtVBNCCompiler_Text() As String
            Get
                Return GetSetting("txtVBNCCompiler_Text2", "")
            End Get
            Set(ByVal value As String)
                SaveSetting("txtVBNCCompiler_Text2", value)
            End Set
        End Property
        Shared Property txtBasePath_Text() As String
            Get
                Return GetSetting("txtBasePath_Text2", "")
            End Get
            Set(ByVal value As String)
                SaveSetting("txtBasePath_Text2", value)
            End Set
        End Property
        Shared Property TestsListView_colPath_Width() As Integer
            Get
                Return CInt(GetSetting("TestsListView_colPath_Width", 80))
            End Get
            Set(ByVal value As Integer)
                SaveSetting("TestsListView_colPath_Width", value)
            End Set
        End Property
        Shared Property TestsListView_colName_Width() As Integer
            Get
                Return CInt(GetSetting("TestsListView_colName_Width", 80))
            End Get
            Set(ByVal value As Integer)
                SaveSetting("TestsListView_colName_Width", value)
            End Set
        End Property
        Shared Property TestsListView_colCompiler_Width() As Integer
            Get
                Return CInt(GetSetting("TestsListView_colCompiler_Width", 80))
            End Get
            Set(ByVal value As Integer)
                SaveSetting("TestsListView_colCompiler_Width", value)
            End Set
        End Property
        Shared Property TestsListView_colResult_Width() As Integer
            Get
                Return CInt(GetSetting("TestsListView_colResult_Width", 80))
            End Get
            Set(ByVal value As Integer)
                SaveSetting("TestsListView_colResult_Width", value)
            End Set
        End Property
        Shared Property TestsListView_colFailedVerification_Width() As Integer
            Get
                Return CInt(GetSetting("TestsListView_colFailedVerification_Width", 80))
            End Get
            Set(ByVal value As Integer)
                SaveSetting("TestsListView_colFailedVerification_Width", value)
            End Set
        End Property
        Shared Property TestsListView_colDate_Width() As Integer
            Get
                Return CInt(GetSetting("TestsListView_colDate_Width", 80))
            End Get
            Set(ByVal value As Integer)
                SaveSetting("TestsListView_colDate_Width", value)
            End Set
        End Property
        Shared Property TestsListView_colKnownFailureReason_Width() As Integer
            Get
                Return CInt(GetSetting("TestsListView_colKnownFailureReason_Width", 80))
            End Get
            Set(ByVal value As Integer)
                SaveSetting("TestsListView_colKnownFailureReason_Width", value)
            End Set
        End Property

        Shared Function GetSetting(ByVal Name As String, ByVal DefaultValue As Object) As String
            Return Microsoft.VisualBasic.GetSetting(System.Windows.Forms.Application.ProductName, "Settings", Name, CStr(DefaultValue))
        End Function
        Shared Sub SaveSetting(ByVal Name As String, ByVal Value As Object)
            Microsoft.VisualBasic.SaveSetting(System.Windows.Forms.Application.ProductName, "Settings", Name, CStr(Value))
        End Sub
    End Class

End Namespace