root/lang/vb2005/Tween/Tween/TwConfig.vb @ 23890

Revision 23890, 52.5 kB (checked in by takeshik, 5 years ago)

ライセンス告知の追加 (分割コミット) 完了

Line 
1' Tween - Client of Twitter
2' Copyright © 2007-2008 kiri_feather (@kiri_feather) <kiri_feather@gmail.com>
3'           © 2008      Moz (@syo68k) <http://iddy.jp/profile/moz/>
4'           © 2008      takeshik (@takeshik) <http://www.takeshik.org/>
5' All rights reserved.
6'
7' This file is part of Tween.
8'
9' This program is free software; you can redistribute it and/or modify it
10' under the terms of the GNU General Public License as published by the Free
11' Software Foundation; either version 3 of the License, or (at your option)
12' any later version.
13'
14' This program is distributed in the hope that it will be useful, but
15' WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16' or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17' for more details.
18'
19' You should have received a copy of the GNU General Public License along
20' with this program. If not, see <http://www.gnu.org/licenses/>, or write to
21' the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
22' Boston, MA 02110-1301, USA.
23
24Imports System.Configuration
25
26Public Class ListElement
27    Inherits ConfigurationElement
28
29    'Public Enum IconSizes
30    '    IconNone = 0
31    '    Icon16 = 1
32    '    Icon24 = 2
33    '    Icon48 = 3
34    'End Enum
35
36    Public Sub New()
37
38    End Sub
39
40    Public Sub New(ByVal name As String)
41        Me("name") = name
42    End Sub
43
44    <ConfigurationProperty("name", DefaultValue:="", IsKey:=True)> _
45    Public Property Name() As String
46        Get
47            Return CStr(Me("name"))
48        End Get
49        Set(ByVal value As String)
50            Me("name") = value
51        End Set
52    End Property
53
54    '<ConfigurationProperty("width1", DefaultValue:=30)> _
55    'Public Property Width1() As Integer
56    '    Get
57    '        Return CInt(Me("width1"))
58    '    End Get
59    '    Set(ByVal value As Integer)
60    '        Me("width1") = value
61    '    End Set
62    'End Property
63
64    '<ConfigurationProperty("width2", DefaultValue:=80)> _
65    'Public Property Width2() As Integer
66    '    Get
67    '        Return CInt(Me("width2"))
68    '    End Get
69    '    Set(ByVal value As Integer)
70    '        Me("width2") = value
71    '    End Set
72    'End Property
73
74    '<ConfigurationProperty("width3", DefaultValue:=290)> _
75    'Public Property Width3() As Integer
76    '    Get
77    '        Return CInt(Me("width3"))
78    '    End Get
79    '    Set(ByVal value As Integer)
80    '        Me("width3") = value
81    '    End Set
82    'End Property
83
84    '<ConfigurationProperty("width4", DefaultValue:=120)> _
85    'Public Property Width4() As Integer
86    '    Get
87    '        Return CInt(Me("width4"))
88    '    End Get
89    '    Set(ByVal value As Integer)
90    '        Me("width4") = value
91    '    End Set
92    'End Property
93
94    '<ConfigurationProperty("width5", DefaultValue:=50)> _
95    'Public Property Width5() As Integer
96    '    Get
97    '        Return CInt(Me("width5"))
98    '    End Get
99    '    Set(ByVal value As Integer)
100    '        Me("width5") = value
101    '    End Set
102    'End Property
103
104    '<ConfigurationProperty("sortcolumn", DefaultValue:=3)> _
105    'Public Property SortColumn() As Integer
106    '    Get
107    '        Return CInt(Me("sortcolumn"))
108    '    End Get
109    '    Set(ByVal value As Integer)
110    '        Me("sortcolumn") = value
111    '    End Set
112    'End Property
113
114    '<ConfigurationProperty("sortorder", DefaultValue:=1)> _
115    'Public Property SortOrder() As Integer
116    '    Get
117    '        Return CInt(Me("sortorder"))
118    '    End Get
119    '    Set(ByVal value As Integer)
120    '        Me("sortorder") = value
121    '    End Set
122    'End Property
123
124    '<ConfigurationProperty("iconsize", DefaultValue:=IconSizes.Icon24)> _
125    'Public Property IconSize() As IconSizes
126    '    Get
127    '        Return Me("iconsize")
128    '    End Get
129    '    Set(ByVal value As IconSizes)
130    '        Me("iconsize") = value
131    '    End Set
132    'End Property
133
134    '<ConfigurationProperty("displayindex1", DefaultValue:=0)> _
135    'Public Property DisplayIndex1() As Integer
136    '    Get
137    '        Return CInt(Me("displayindex1"))
138    '    End Get
139    '    Set(ByVal value As Integer)
140    '        Me("displayindex1") = value
141    '    End Set
142    'End Property
143
144    '<ConfigurationProperty("displayindex2", DefaultValue:=1)> _
145    'Public Property DisplayIndex2() As Integer
146    '    Get
147    '        Return CInt(Me("displayindex2"))
148    '    End Get
149    '    Set(ByVal value As Integer)
150    '        Me("displayindex2") = value
151    '    End Set
152    'End Property
153
154    '<ConfigurationProperty("displayindex3", DefaultValue:=2)> _
155    'Public Property DisplayIndex3() As Integer
156    '    Get
157    '        Return CInt(Me("displayindex3"))
158    '    End Get
159    '    Set(ByVal value As Integer)
160    '        Me("displayindex3") = value
161    '    End Set
162    'End Property
163
164    '<ConfigurationProperty("displayindex4", DefaultValue:=3)> _
165    'Public Property DisplayIndex4() As Integer
166    '    Get
167    '        Return CInt(Me("displayindex4"))
168    '    End Get
169    '    Set(ByVal value As Integer)
170    '        Me("displayindex4") = value
171    '    End Set
172    'End Property
173
174    '<ConfigurationProperty("displayindex5", DefaultValue:=4)> _
175    'Public Property DisplayIndex5() As Integer
176    '    Get
177    '        Return CInt(Me("displayindex5"))
178    '    End Get
179    '    Set(ByVal value As Integer)
180    '        Me("displayindex5") = value
181    '    End Set
182    'End Property
183
184    <ConfigurationProperty("unreadmanage", DefaultValue:=True)> _
185    Public Property UnreadManage() As Boolean
186        Get
187            Return CBool(Me("unreadmanage"))
188        End Get
189        Set(ByVal value As Boolean)
190            Me("unreadmanage") = value
191        End Set
192    End Property
193
194    <ConfigurationProperty("notify", DefaultValue:=True)> _
195    Public Property Notify() As Boolean
196        Get
197            Return CBool(Me("notify"))
198        End Get
199        Set(ByVal value As Boolean)
200            Me("notify") = value
201        End Set
202    End Property
203
204    <ConfigurationProperty("soundfile", DefaultValue:="")> _
205    Public Property SoundFile() As String
206        Get
207            Return DirectCast(Me("soundfile"), String)
208        End Get
209        Set(ByVal value As String)
210            Me("soundfile") = value
211        End Set
212    End Property
213
214End Class
215
216'Public Class LogPost
217'    Inherits ConfigurationElement
218
219'    Public Enum Unread
220'        Unread = 0
221'        Readed = 1
222'    End Enum
223
224'    Public Enum Fav
225'        NoFav = 0
226'        Fav = 1
227'    End Enum
228
229'    Public Sub New()
230
231'    End Sub
232
233'    Public Sub New(ByVal name As String)
234'        Me("name") = name
235'    End Sub
236
237'    <ConfigurationProperty("name", DefaultValue:="")> _
238'    Public Property Name() As String
239'        Get
240'            Return CStr(Me("name"))
241'        End Get
242'        Set(ByVal value As String)
243'            Me("name") = value
244'        End Set
245'    End Property
246
247'    <ConfigurationProperty("name2", DefaultValue:="")> _
248'    Public Property Name2() As String
249'        Get
250'            Return CStr(Me("name2"))
251'        End Get
252'        Set(ByVal value As String)
253'            Me("name2") = value
254'        End Set
255'    End Property
256
257'    <ConfigurationProperty("id", DefaultValue:="")> _
258'    Public Property Id() As String
259'        Get
260'            Return CStr(Me("id"))
261'        End Get
262'        Set(ByVal value As String)
263'            Me("id") = value
264'        End Set
265'    End Property
266
267'    <ConfigurationProperty("nick", DefaultValue:="")> _
268'    Public Property Nick() As String
269'        Get
270'            Return CStr(Me("nick"))
271'        End Get
272'        Set(ByVal value As String)
273'            Me("nick") = value
274'        End Set
275'    End Property
276
277'    <ConfigurationProperty("post", DefaultValue:="")> _
278'    Public Property Post() As String
279'        Get
280'            Return CStr(Me("post"))
281'        End Get
282'        Set(ByVal value As String)
283'            Me("post") = value
284'        End Set
285'    End Property
286
287'    <ConfigurationProperty("pdate", DefaultValue:="")> _
288'    Public Property PostDate() As String
289'        Get
290'            Return CStr(Me("pdate"))
291'        End Get
292'        Set(ByVal value As String)
293'            Me("pdate") = value
294'        End Set
295'    End Property
296
297'    <ConfigurationProperty("imgurl", DefaultValue:="")> _
298'    Public Property ImageUrl() As String
299'        Get
300'            Return CStr(Me("imgurl"))
301'        End Get
302'        Set(ByVal value As String)
303'            Me("imgurl") = value
304'        End Set
305'    End Property
306
307'    <ConfigurationProperty("unread", DefaultValue:=Unread.Unread)> _
308'    Public Property IsUnread() As Unread
309'        Get
310'            Return CType(Me("unread"), Unread)
311'        End Get
312'        Set(ByVal value As Unread)
313'            Me("unread") = value
314'        End Set
315'    End Property
316
317'    <ConfigurationProperty("fav", DefaultValue:=Fav.NoFav)> _
318'    Public Property IsFav() As Fav
319'        Get
320'            Return CType(Me("fav"), Fav)
321'        End Get
322'        Set(ByVal value As Fav)
323'            Me("fav") = value
324'        End Set
325'    End Property
326
327'End Class
328
329Public Class SelectedUser
330    Inherits ConfigurationElement
331
332    Public Sub New()
333
334    End Sub
335
336    Public Sub New(ByVal name As String)
337        Me("name") = name
338    End Sub
339
340    '<ConfigurationProperty("name", DefaultValue:="", IsKey:=True, IsRequired:=True)> _
341    <ConfigurationProperty("name", DefaultValue:="")> _
342    Public Property Name() As String
343        Get
344            Return CStr(Me("name"))
345        End Get
346        Set(ByVal value As String)
347            Me("name") = value
348        End Set
349    End Property
350
351    <ConfigurationProperty("tabname", DefaultValue:="")> _
352    Public Property TabName() As String
353        Get
354            Return CStr(Me("tabname"))
355        End Get
356        Set(ByVal value As String)
357            Me("tabname") = value
358        End Set
359    End Property
360
361    <ConfigurationProperty("idfilter", DefaultValue:="")> _
362    Public Property IdFilter() As String
363        Get
364            Return CStr(Me("idfilter"))
365        End Get
366        Set(ByVal value As String)
367            Me("idfilter") = value
368        End Set
369    End Property
370
371    <ConfigurationProperty("bodyfilter", DefaultValue:="")> _
372    Public Property BodyFilter() As String
373        Get
374            Return CStr(Me("bodyfilter"))
375        End Get
376        Set(ByVal value As String)
377            Me("bodyfilter") = value
378        End Set
379    End Property
380
381    <ConfigurationProperty("moveFrom", DefaultValue:=False)> _
382    Public Property MoveFrom() As Boolean
383        Get
384            Return CBool(Me("moveFrom"))
385        End Get
386        Set(ByVal value As Boolean)
387            Me("moveFrom") = value
388        End Set
389    End Property
390
391    <ConfigurationProperty("searchboth", DefaultValue:=False)> _
392    Public Property SearchBoth() As Boolean
393        Get
394            Return CBool(Me("searchboth"))
395        End Get
396        Set(ByVal value As Boolean)
397            Me("searchboth") = value
398        End Set
399    End Property
400
401    <ConfigurationProperty("regexenable", DefaultValue:=False)> _
402    Public Property RegexEnable() As Boolean
403        Get
404            Return CBool(Me("regexenable"))
405        End Get
406        Set(ByVal value As Boolean)
407            Me("regexenable") = value
408        End Set
409    End Property
410
411    <ConfigurationProperty("urlsearch", DefaultValue:=False)> _
412    Public Property UrlSearch() As Boolean
413        Get
414            Return CBool(Me("urlsearch"))
415        End Get
416        Set(ByVal value As Boolean)
417            Me("urlsearch") = value
418        End Set
419    End Property
420
421    <ConfigurationProperty("setmark", DefaultValue:=False)> _
422    Public Property SetMark() As Boolean
423        Get
424            Return CBool(Me("setmark"))
425        End Get
426        Set(ByVal value As Boolean)
427            Me("setmark") = value
428        End Set
429    End Property
430
431End Class
432
433Public Class ListElementCollection
434    Inherits ConfigurationElementCollection
435
436    Public Sub New()
437        Dim lElement As ListElement = CType(CreateNewElement(), ListElement)
438        Add(lElement)
439    End Sub
440
441    Public Sub New(ByVal Name As String)
442        Dim lElement As ListElement = CType(CreateNewElement(Name), ListElement)
443        Add(lElement)
444    End Sub
445
446    Protected Overloads Overrides Function CreateNewElement() As System.Configuration.ConfigurationElement
447        Return New ListElement
448    End Function
449
450    Protected Overloads Overrides Function CreateNewElement(ByVal Name As String) As System.Configuration.ConfigurationElement
451        Return New ListElement(Name)
452    End Function
453
454    Protected Overrides Function GetElementKey(ByVal element As System.Configuration.ConfigurationElement) As Object
455        Return CType(element, ListElement).Name
456    End Function
457
458    Public Overrides ReadOnly Property CollectionType() As ConfigurationElementCollectionType
459        Get
460            Return ConfigurationElementCollectionType.AddRemoveClearMap
461        End Get
462    End Property
463
464    Public Shadows Property AddElementName() As String
465        Get
466            Return MyBase.AddElementName
467        End Get
468        Set(ByVal value As String)
469            MyBase.AddElementName = value
470        End Set
471    End Property
472
473    Public Shadows Property ClearElementName() As String
474        Get
475            Return MyBase.ClearElementName
476        End Get
477        Set(ByVal value As String)
478            MyBase.ClearElementName = value
479        End Set
480    End Property
481
482    Public Shadows ReadOnly Property RemoveElementName() As String
483        Get
484            Return MyBase.RemoveElementName
485        End Get
486    End Property
487
488    Public Shadows ReadOnly Property Count() As Integer
489        Get
490            Return MyBase.Count
491        End Get
492    End Property
493
494    Default Public Shadows Property Item(ByVal index As Integer) As ListElement
495        Get
496            Return CType(BaseGet(index), ListElement)
497        End Get
498        Set(ByVal value As ListElement)
499            If Not (BaseGet(index)) Is Nothing Then
500                BaseRemoveAt(index)
501            End If
502            BaseAdd(index, value)
503        End Set
504    End Property
505
506    Default Public Shadows ReadOnly Property Item(ByVal Name As String) As ListElement
507        Get
508            Return CType(BaseGet(Name), ListElement)
509        End Get
510    End Property
511
512    Public Function IndexOf(ByVal listElement As ListElement) As Integer
513        Return BaseIndexOf(listElement)
514    End Function
515
516    Public Sub Add(ByVal listElement As ListElement)
517        BaseAdd(listElement)
518    End Sub
519
520    Protected Overrides Sub BaseAdd(ByVal element As System.Configuration.ConfigurationElement)
521        MyBase.BaseAdd(element)
522    End Sub
523
524    Public Overloads Sub Remove(ByVal listElement As ListElement)
525        If BaseIndexOf(listElement) >= 0 Then
526            BaseRemove(listElement.Name)
527        End If
528    End Sub
529
530    Public Sub RemoveAt(ByVal index As Integer)
531        BaseRemoveAt(index)
532    End Sub
533
534    Public Overloads Sub Remove(ByVal name As String)
535        BaseRemove(name)
536    End Sub
537
538    Public Sub Clear()
539        BaseClear()
540    End Sub
541End Class
542
543'Public Class LogPostCollection
544'    Inherits ConfigurationElementCollection
545
546'    Public Sub New()
547'        Dim lPost As LogPost = CType(CreateNewElement(), LogPost)
548'        Add(lPost)
549'    End Sub
550
551'    Public Sub New(ByVal Name As String)
552'        Dim lPost As LogPost = CType(CreateNewElement(Name), LogPost)
553'        Add(lPost)
554'    End Sub
555
556'    Protected Overloads Overrides Function CreateNewElement() As System.Configuration.ConfigurationElement
557'        Return New LogPost
558'    End Function
559
560'    Protected Overloads Overrides Function CreateNewElement(ByVal Name As String) As System.Configuration.ConfigurationElement
561'        Return New LogPost(Name)
562'    End Function
563
564'    Protected Overrides Function GetElementKey(ByVal element As System.Configuration.ConfigurationElement) As Object
565'        Return CType(element, LogPost).Name
566'    End Function
567
568'    Public Overrides ReadOnly Property CollectionType() As ConfigurationElementCollectionType
569'        Get
570'            Return ConfigurationElementCollectionType.AddRemoveClearMap
571'        End Get
572'    End Property
573
574'    Public Shadows Property AddElementName() As String
575'        Get
576'            Return MyBase.AddElementName
577'        End Get
578'        Set(ByVal value As String)
579'            MyBase.AddElementName = value
580'        End Set
581'    End Property
582
583'    Public Shadows Property ClearElementName() As String
584'        Get
585'            Return MyBase.ClearElementName
586'        End Get
587'        Set(ByVal value As String)
588'            MyBase.ClearElementName = value
589'        End Set
590'    End Property
591
592'    Public Shadows ReadOnly Property RemoveElementName() As String
593'        Get
594'            Return MyBase.RemoveElementName
595'        End Get
596'    End Property
597
598'    Public Shadows ReadOnly Property Count() As Integer
599'        Get
600'            Return MyBase.Count
601'        End Get
602'    End Property
603
604'    Default Public Shadows Property Item(ByVal index As Integer) As LogPost
605'        Get
606'            Return CType(BaseGet(index), LogPost)
607'        End Get
608'        Set(ByVal value As LogPost)
609'            If Not (BaseGet(index)) Is Nothing Then
610'                BaseRemoveAt(index)
611'            End If
612'            BaseAdd(index, value)
613'        End Set
614'    End Property
615
616'    Default Public Shadows ReadOnly Property Item(ByVal Name As String) As LogPost
617'        Get
618'            Return CType(BaseGet(Name), LogPost)
619'        End Get
620'    End Property
621
622'    Public Function IndexOf(ByVal lPost As LogPost) As Integer
623'        Return BaseIndexOf(lPost)
624'    End Function
625
626'    Public Sub Add(ByVal lPost As LogPost)
627'        BaseAdd(lPost)
628'    End Sub
629
630'    Protected Overrides Sub BaseAdd(ByVal element As System.Configuration.ConfigurationElement)
631'        MyBase.BaseAdd(element)
632'    End Sub
633
634'    Public Overloads Sub Remove(ByVal lPost As LogPost)
635'        If BaseIndexOf(lPost) >= 0 Then
636'            BaseRemove(lPost.Name)
637'        End If
638'    End Sub
639
640'    Public Sub RemoveAt(ByVal index As Integer)
641'        BaseRemoveAt(index)
642'    End Sub
643
644'    Public Overloads Sub Remove(ByVal name As String)
645'        BaseRemove(name)
646'    End Sub
647
648'    Public Sub Clear()
649'        BaseClear()
650'    End Sub
651'End Class
652
653Public Class SelectedUserCollection
654    Inherits ConfigurationElementCollection
655
656    Public Sub New()
657        Dim lElement As SelectedUser = CType(CreateNewElement(), SelectedUser)
658        Add(lElement)
659    End Sub
660
661    Protected Overloads Overrides Function CreateNewElement() As System.Configuration.ConfigurationElement
662        Return New SelectedUser
663    End Function
664
665    Protected Overloads Overrides Function CreateNewElement(ByVal Name As String) As System.Configuration.ConfigurationElement
666        Return New SelectedUser(Name)
667    End Function
668
669    Protected Overrides Function GetElementKey(ByVal element As System.Configuration.ConfigurationElement) As Object
670        Return CType(element, SelectedUser).Name
671    End Function
672
673    Public Overrides ReadOnly Property CollectionType() As ConfigurationElementCollectionType
674        Get
675            Return ConfigurationElementCollectionType.AddRemoveClearMap
676        End Get
677    End Property
678
679    Public Shadows Property AddElementName() As String
680        Get
681            Return MyBase.AddElementName
682        End Get
683        Set(ByVal value As String)
684            MyBase.AddElementName = value
685        End Set
686    End Property
687
688    Public Shadows Property ClearElementName() As String
689        Get
690            Return MyBase.ClearElementName
691        End Get
692        Set(ByVal value As String)
693            MyBase.ClearElementName = value
694        End Set
695    End Property
696
697    Public Shadows ReadOnly Property RemoveElementName() As String
698        Get
699            Return MyBase.RemoveElementName
700        End Get
701    End Property
702
703    Public Shadows ReadOnly Property Count() As Integer
704        Get
705            Return MyBase.Count
706        End Get
707    End Property
708
709    Default Public Shadows Property Item(ByVal index As Integer) As SelectedUser
710        Get
711            Return CType(BaseGet(index), SelectedUser)
712        End Get
713        Set(ByVal value As SelectedUser)
714            If Not (BaseGet(index)) Is Nothing Then
715                BaseRemoveAt(index)
716            End If
717            BaseAdd(index, value)
718        End Set
719    End Property
720
721    Default Public Shadows ReadOnly Property Item(ByVal Name As String) As SelectedUser
722        Get
723            Return CType(BaseGet(Name), SelectedUser)
724        End Get
725    End Property
726
727    Public Function IndexOf(ByVal selectedUser As SelectedUser) As Integer
728        Return BaseIndexOf(selectedUser)
729    End Function
730
731    Public Sub Add(ByVal selectedUser As SelectedUser)
732        BaseAdd(selectedUser)
733    End Sub
734
735    Protected Overrides Sub BaseAdd(ByVal element As System.Configuration.ConfigurationElement)
736        MyBase.BaseAdd(element)
737    End Sub
738
739    Public Overloads Sub Remove(ByVal selectedUser As SelectedUser)
740        If BaseIndexOf(selectedUser) >= 0 Then
741            BaseRemove(selectedUser.Name)
742        End If
743    End Sub
744
745    Public Sub RemoveAt(ByVal index As Integer)
746        BaseRemoveAt(index)
747    End Sub
748
749    Public Overloads Sub Remove(ByVal name As String)
750        BaseRemove(name)
751    End Sub
752
753    Public Sub Clear()
754        BaseClear()
755    End Sub
756End Class
757
758Public NotInheritable Class ListSection
759    Inherits ConfigurationSection
760
761    'Public Enum LogUnitEnum
762    '    Minute
763    '    Hour
764    '    Day
765    'End Enum
766
767    'Public Enum IconSizes
768    '    IconNone = 0
769    '    Icon16 = 1
770    '    Icon24 = 2
771    '    Icon48 = 3
772    '    Icon48_2 = 4
773    'End Enum
774
775    'Public Enum NameBalloonEnum
776    '    None
777    '    UserID
778    '    NickName
779    'End Enum
780
781    'Public Enum DispTitleEnum
782    '    None
783    '    Ver
784    '    Post
785    '    UnreadRepCount
786    '    UnreadAllCount
787    '    UnreadAllRepCount
788    '    UnreadCountAllCount
789    'End Enum
790
791    <ConfigurationProperty("listelement", IsDefaultCollection:=False)> _
792    Public Property ListElement() As ListElementCollection
793        Get
794            Return CType(Me("listelement"), ListElementCollection)
795        End Get
796        Set(ByVal value As ListElementCollection)
797            Me("listelement") = value
798        End Set
799    End Property
800
801    '<ConfigurationProperty("lpost", IsDefaultCollection:=False)> _
802    'Public Property LogPosts() As LogPostCollection
803    '    Get
804    '        Return CType(Me("lpost"), LogPostCollection)
805    '    End Get
806    '    Set(ByVal value As LogPostCollection)
807    '        Me("lpost") = value
808    '    End Set
809    'End Property
810
811    <ConfigurationProperty("username", DefaultValue:="")> _
812    Public Property UserName() As String
813        Get
814            Return CStr(Me("username"))
815        End Get
816        Set(ByVal value As String)
817            Me("username") = value
818        End Set
819    End Property
820
821    <ConfigurationProperty("password", DefaultValue:="")> _
822    Public Property Password() As String
823        Get
824            Dim pwd As String = ""
825            If CStr(Me("password")).Length > 0 Then
826                Try
827                    pwd = DecryptString(CStr(Me("password")))
828                Catch ex As Exception
829                    pwd = ""
830                End Try
831            End If
832            Return pwd
833        End Get
834        Set(ByVal value As String)
835            Dim pwd As String = value.Trim()
836            If pwd.Length > 0 Then
837                Try
838                    Me("password") = EncryptString(value)
839                Catch ex As Exception
840                    Me("password") = ""
841                End Try
842            Else
843                Me("password") = ""
844            End If
845        End Set
846    End Property
847
848    '<ConfigurationProperty("lastid", DefaultValue:="")> _
849    'Public Property LastID() As String
850    '    Get
851    '        Return CStr(Me("lastid"))
852    '    End Get
853    '    Set(ByVal value As String)
854    '        Me("lastid") = value
855    '    End Set
856    'End Property
857
858    '<ConfigurationProperty("lastname", DefaultValue:="")> _
859    'Public Property LastName() As String
860    '    Get
861    '        Return CStr(Me("lastname"))
862    '    End Get
863    '    Set(ByVal value As String)
864    '        Me("lastname") = value
865    '    End Set
866    'End Property
867
868    '<ConfigurationProperty("favname", DefaultValue:="")> _
869    'Public Property FavName() As String
870    '    Get
871    '        Return CStr(Me("favname"))
872    '    End Get
873    '    Set(ByVal value As String)
874    '        Me("favname") = value
875    '    End Set
876    'End Property
877
878    <ConfigurationProperty("formlocation", DefaultValue:="0, 0")> _
879    Public Property FormLocation() As Point
880        Get
881            Return CType(Me("formlocation"), Point)
882        End Get
883        Set(ByVal value As Point)
884            Me("formlocation") = value
885        End Set
886    End Property
887
888    <ConfigurationProperty("splitterdistance", DefaultValue:=320)> _
889    Public Property SplitterDistance() As Integer
890        Get
891            Return CInt(Me("splitterdistance"))
892        End Get
893        Set(ByVal value As Integer)
894            Me("splitterdistance") = value
895        End Set
896    End Property
897
898    <ConfigurationProperty("formsize", DefaultValue:="436, 476")> _
899    Public Property FormSize() As Size
900        Get
901            Return CType(Me("formsize"), Size)
902        End Get
903        Set(ByVal value As Size)
904            Me("formsize") = value
905        End Set
906    End Property
907
908    <ConfigurationProperty("nextpagethreshold", DefaultValue:=20), _
909     IntegerValidator(MaxValue:=20, MinValue:=1)> _
910    Public Property NextPageThreshold() As Integer
911        Get
912            Return CInt(Me("nextpagethreshold"))
913        End Get
914        Set(ByVal value As Integer)
915            Me("nextpagethreshold") = value
916        End Set
917    End Property
918
919    <ConfigurationProperty("nextpages", DefaultValue:=1), _
920     IntegerValidator(MaxValue:=20, MinValue:=1)> _
921    Public Property NextPages() As Integer
922        Get
923            Return CInt(Me("nextpages"))
924        End Get
925        Set(ByVal value As Integer)
926            Me("nextpages") = value
927        End Set
928    End Property
929
930    <ConfigurationProperty("timelineperiod", DefaultValue:=90), _
931     IntegerValidator(MaxValue:=3600, MinValue:=0)> _
932    Public Property TimelinePeriod() As Integer
933        Get
934            Return CInt(Me("timelineperiod"))
935        End Get
936        Set(ByVal value As Integer)
937            Me("timelineperiod") = value
938        End Set
939    End Property
940
941    <ConfigurationProperty("dmperiod", DefaultValue:=600), _
942     IntegerValidator(MaxValue:=3600, MinValue:=0)> _
943    Public Property DMPeriod() As Integer
944        Get
945            Return CInt(Me("dmperiod"))
946        End Get
947        Set(ByVal value As Integer)
948            Me("dmperiod") = value
949        End Set
950    End Property
951
952    '<ConfigurationProperty("logdays", DefaultValue:=3), _
953    ' IntegerValidator(MaxValue:=999, MinValue:=0)> _
954    'Public Property LogDays() As Integer
955    '    Get
956    '        Return CInt(Me("logdays"))
957    '    End Get
958    '    Set(ByVal value As Integer)
959    '        Me("logdays") = value
960    '    End Set
961    'End Property
962
963    '<ConfigurationProperty("logunit", DefaultValue:=LogUnitEnum.Hour)> _
964    'Public Property LogUnit() As LogUnitEnum
965    '    Get
966    '        Return Me("logunit")
967    '    End Get
968    '    Set(ByVal value As LogUnitEnum)
969    '        Me("logunit") = value
970    '    End Set
971    'End Property
972
973    <ConfigurationProperty("readpages", DefaultValue:=10), _
974     IntegerValidator(MaxValue:=999, MinValue:=0)> _
975    Public Property ReadPages() As Integer
976        Get
977            Return CInt(Me("readpages"))
978        End Get
979        Set(ByVal value As Integer)
980            Me("readpages") = value
981        End Set
982    End Property
983
984    <ConfigurationProperty("readpagesreply", DefaultValue:=1), _
985     IntegerValidator(MaxValue:=999, MinValue:=0)> _
986    Public Property ReadPagesReply() As Integer
987        Get
988            Return CInt(Me("readpagesreply"))
989        End Get
990        Set(ByVal value As Integer)
991            Me("readpagesreply") = value
992        End Set
993    End Property
994
995    <ConfigurationProperty("readpagesdm", DefaultValue:=1), _
996     IntegerValidator(MaxValue:=999, MinValue:=0)> _
997    Public Property ReadPagesDM() As Integer
998        Get
999            Return CInt(Me("readpagesdm"))
1000        End Get
1001        Set(ByVal value As Integer)
1002            Me("readpagesdm") = value
1003        End Set
1004    End Property
1005    <ConfigurationProperty("maxpostnum", DefaultValue:=125), _
1006     IntegerValidator(MaxValue:=999, MinValue:=1)> _
1007    Public Property MaxPostNum() As Integer
1008        Get
1009            Return CInt(Me("maxpostnum"))
1010        End Get
1011        Set(ByVal value As Integer)
1012            Me("maxpostnum") = value
1013        End Set
1014    End Property
1015
1016    <ConfigurationProperty("readed", DefaultValue:=True)> _
1017    Public Property Readed() As Boolean
1018        Get
1019            Return CBool(Me("readed"))
1020        End Get
1021        Set(ByVal value As Boolean)
1022            Me("readed") = value
1023        End Set
1024    End Property
1025
1026    <ConfigurationProperty("listlock", DefaultValue:=False)> _
1027    Public Property ListLock() As Boolean
1028        Get
1029            Return CBool(Me("listlock"))
1030        End Get
1031        Set(ByVal value As Boolean)
1032            Me("listlock") = value
1033        End Set
1034    End Property
1035
1036    <ConfigurationProperty("listiconsize", DefaultValue:=IconSizes.Icon16)> _
1037    Public Property IconSize() As IconSizes
1038        Get
1039            Return DirectCast(Me("listiconsize"), IconSizes)
1040        End Get
1041        Set(ByVal value As IconSizes)
1042            Me("listiconsize") = value
1043        End Set
1044    End Property
1045
1046    <ConfigurationProperty("selecteduser", IsDefaultCollection:=False)> _
1047    Public Property SelectedUser() As SelectedUserCollection
1048        Get
1049            Return CType(Me("selecteduser"), SelectedUserCollection)
1050        End Get
1051        Set(ByVal value As SelectedUserCollection)
1052            Me("selecteduser") = value
1053        End Set
1054    End Property
1055
1056    <ConfigurationProperty("newallpop", DefaultValue:=True)> _
1057    Public Property NewAllPop() As Boolean
1058        Get
1059            Return CBool(Me("newallpop"))
1060        End Get
1061        Set(ByVal value As Boolean)
1062            Me("newallpop") = value
1063        End Set
1064    End Property
1065
1066    '<ConfigurationProperty("newreplypop", DefaultValue:=False)> _
1067    'Public Property NewReplyPop() As Boolean
1068    '    Get
1069    '        Return CBool(Me("newreplypop"))
1070    '    End Get
1071    '    Set(ByVal value As Boolean)
1072    '        Me("newreplypop") = value
1073    '    End Set
1074    'End Property
1075
1076    '<ConfigurationProperty("newdmpop", DefaultValue:=False)> _
1077    'Public Property NewDMPop() As Boolean
1078    '    Get
1079    '        Return CBool(Me("newdmpop"))
1080    '    End Get
1081    '    Set(ByVal value As Boolean)
1082    '        Me("newdmpop") = value
1083    '    End Set
1084    'End Property
1085
1086    <ConfigurationProperty("statustext", DefaultValue:="")> _
1087    Public Property StatusText() As String
1088        Get
1089            Return CStr(Me("statustext"))
1090        End Get
1091        Set(ByVal value As String)
1092            Me("statustext") = value
1093        End Set
1094    End Property
1095
1096    <ConfigurationProperty("playsound", DefaultValue:=False)> _
1097    Public Property PlaySound() As Boolean
1098        Get
1099            Return CBool(Me("playsound"))
1100        End Get
1101        Set(ByVal value As Boolean)
1102            Me("playsound") = value
1103        End Set
1104    End Property
1105
1106    <ConfigurationProperty("unreadmanage", DefaultValue:=True)> _
1107    Public Property UnreadManage() As Boolean
1108        Get
1109            Return CBool(Me("unreadmanage"))
1110        End Get
1111        Set(ByVal value As Boolean)
1112            Me("unreadmanage") = value
1113        End Set
1114    End Property
1115
1116    <ConfigurationProperty("onewaylove", DefaultValue:=True)> _
1117    Public Property OneWayLove() As Boolean
1118        Get
1119            Return CBool(Me("onewaylove"))
1120        End Get
1121        Set(ByVal value As Boolean)
1122            Me("onewaylove") = value
1123        End Set
1124    End Property
1125
1126    <ConfigurationProperty("fontunread", DefaultValue:="MS UI Gothic, 9pt, style=Bold, Underline")> _
1127    Public Property FontUnread() As System.Drawing.Font
1128        Get
1129            Return DirectCast(Me("fontunread"), System.Drawing.Font)
1130        End Get
1131        Set(ByVal value As Font)
1132            Me("fontunread") = value
1133        End Set
1134    End Property
1135
1136    <ConfigurationProperty("colorunread", DefaultValue:="ControlText")> _
1137    Public Property ColorUnread() As Color
1138        Get
1139            Return DirectCast(Me("colorunread"), Color)
1140        End Get
1141        Set(ByVal value As Color)
1142            Me("colorunread") = value
1143        End Set
1144    End Property
1145
1146    <ConfigurationProperty("fontreaded", DefaultValue:="MS UI Gothic, 9pt")> _
1147    Public Property FontReaded() As Font
1148        Get
1149            Return DirectCast(Me("fontreaded"), Font)
1150        End Get
1151        Set(ByVal value As Font)
1152            Me("fontreaded") = value
1153        End Set
1154    End Property
1155
1156    <ConfigurationProperty("colorreaded", DefaultValue:="ControlText")> _
1157    Public Property ColorReaded() As Color
1158        Get
1159            Return DirectCast(Me("colorreaded"), Color)
1160        End Get
1161        Set(ByVal value As Color)
1162            Me("colorreaded") = value
1163        End Set
1164    End Property
1165
1166    <ConfigurationProperty("colorfav", DefaultValue:="Red")> _
1167    Public Property ColorFav() As Color
1168        Get
1169            Return DirectCast(Me("colorfav"), Color)
1170        End Get
1171        Set(ByVal value As Color)
1172            Me("colorfav") = value
1173        End Set
1174    End Property
1175
1176    <ConfigurationProperty("colorOWL", DefaultValue:="Blue")> _
1177    Public Property ColorOWL() As Color
1178        Get
1179            Return DirectCast(Me("colorOWL"), Color)
1180        End Get
1181        Set(ByVal value As Color)
1182            Me("colorOWL") = value
1183        End Set
1184    End Property
1185
1186    <ConfigurationProperty("fontDetail", DefaultValue:="MS UI Gothic, 9pt")> _
1187    Public Property FontDetail() As Font
1188        Get
1189            Return DirectCast(Me("fontDetail"), Font)
1190        End Get
1191        Set(ByVal value As Font)
1192            Me("fontDetail") = value
1193        End Set
1194    End Property
1195
1196    <ConfigurationProperty("colorSelf", DefaultValue:="AliceBlue")> _
1197    Public Property ColorSelf() As Color
1198        Get
1199            Return DirectCast(Me("colorSelf"), Color)
1200        End Get
1201        Set(ByVal value As Color)
1202            Me("colorSelf") = value
1203        End Set
1204    End Property
1205
1206    <ConfigurationProperty("colorAtSelf", DefaultValue:="AntiqueWhite")> _
1207    Public Property ColorAtSelf() As Color
1208        Get
1209            Return DirectCast(Me("colorAtSelf"), Color)
1210        End Get
1211        Set(ByVal value As Color)
1212            Me("colorAtSelf") = value
1213        End Set
1214    End Property
1215
1216    <ConfigurationProperty("colorTarget", DefaultValue:="LemonChiffon")> _
1217    Public Property ColorTarget() As Color
1218        Get
1219            Return DirectCast(Me("colorTarget"), Color)
1220        End Get
1221        Set(ByVal value As Color)
1222            Me("colorTarget") = value
1223        End Set
1224    End Property
1225
1226    <ConfigurationProperty("colorAtTarget", DefaultValue:="LavenderBlush")> _
1227    Public Property ColorAtTarget() As Color
1228        Get
1229            Return DirectCast(Me("colorAtTarget"), Color)
1230        End Get
1231        Set(ByVal value As Color)
1232            Me("colorAtTarget") = value
1233        End Set
1234    End Property
1235
1236    <ConfigurationProperty("colorAtFromTarget", DefaultValue:="Honeydew")> _
1237    Public Property ColorAtFromTarget() As Color
1238        Get
1239            Return DirectCast(Me("colorAtFromTarget"), Color)
1240        End Get
1241        Set(ByVal value As Color)
1242            Me("colorAtFromTarget") = value
1243        End Set
1244    End Property
1245
1246    <ConfigurationProperty("nameballoon", DefaultValue:=NameBalloonEnum.NickName)> _
1247    Public Property NameBalloon() As NameBalloonEnum
1248        Get
1249            Return DirectCast(Me("nameballoon"), NameBalloonEnum)
1250        End Get
1251        Set(ByVal value As NameBalloonEnum)
1252            Me("nameballoon") = value
1253        End Set
1254    End Property
1255
1256    <ConfigurationProperty("width1", DefaultValue:=30)> _
1257    Public Property Width1() As Integer
1258        Get
1259            Return CInt(Me("width1"))
1260        End Get
1261        Set(ByVal value As Integer)
1262            Me("width1") = value
1263        End Set
1264    End Property
1265
1266    <ConfigurationProperty("width2", DefaultValue:=80)> _
1267    Public Property Width2() As Integer
1268        Get
1269            Return CInt(Me("width2"))
1270        End Get
1271        Set(ByVal value As Integer)
1272            Me("width2") = value
1273        End Set
1274    End Property
1275
1276    <ConfigurationProperty("width3", DefaultValue:=290)> _
1277    Public Property Width3() As Integer
1278        Get
1279            Return CInt(Me("width3"))
1280        End Get
1281        Set(ByVal value As Integer)
1282            Me("width3") = value
1283        End Set
1284    End Property
1285
1286    <ConfigurationProperty("width4", DefaultValue:=120)> _
1287    Public Property Width4() As Integer
1288        Get
1289            Return CInt(Me("width4"))
1290        End Get
1291        Set(ByVal value As Integer)
1292            Me("width4") = value
1293        End Set
1294    End Property
1295
1296    <ConfigurationProperty("width5", DefaultValue:=50)> _
1297    Public Property Width5() As Integer
1298        Get
1299            Return CInt(Me("width5"))
1300        End Get
1301        Set(ByVal value As Integer)
1302            Me("width5") = value
1303        End Set
1304    End Property
1305
1306    <ConfigurationProperty("sortcolumn", DefaultValue:=3)> _
1307    Public Property SortColumn() As Integer
1308        Get
1309            Return CInt(Me("sortcolumn"))
1310        End Get
1311        Set(ByVal value As Integer)
1312            Me("sortcolumn") = value
1313        End Set
1314    End Property
1315
1316    <ConfigurationProperty("sortorder", DefaultValue:=1)> _
1317    Public Property SortOrder() As Integer
1318        Get
1319            Return CInt(Me("sortorder"))
1320        End Get
1321        Set(ByVal value As Integer)
1322            Me("sortorder") = value
1323        End Set
1324    End Property
1325
1326    <ConfigurationProperty("displayindex1", DefaultValue:=0)> _
1327    Public Property DisplayIndex1() As Integer
1328        Get
1329            Return CInt(Me("displayindex1"))
1330        End Get
1331        Set(ByVal value As Integer)
1332            Me("displayindex1") = value
1333        End Set
1334    End Property
1335
1336    <ConfigurationProperty("displayindex2", DefaultValue:=1)> _
1337    Public Property DisplayIndex2() As Integer
1338        Get
1339            Return CInt(Me("displayindex2"))
1340        End Get
1341        Set(ByVal value As Integer)
1342            Me("displayindex2") = value
1343        End Set
1344    End Property
1345
1346    <ConfigurationProperty("displayindex3", DefaultValue:=2)> _
1347    Public Property DisplayIndex3() As Integer
1348        Get
1349            Return CInt(Me("displayindex3"))
1350        End Get
1351        Set(ByVal value As Integer)
1352            Me("displayindex3") = value
1353        End Set
1354    End Property
1355
1356    <ConfigurationProperty("displayindex4", DefaultValue:=3)> _
1357    Public Property DisplayIndex4() As Integer
1358        Get
1359            Return CInt(Me("displayindex4"))
1360        End Get
1361        Set(ByVal value As Integer)
1362            Me("displayindex4") = value
1363        End Set
1364    End Property
1365
1366    <ConfigurationProperty("displayindex5", DefaultValue:=4)> _
1367    Public Property DisplayIndex5() As Integer
1368        Get
1369            Return CInt(Me("displayindex5"))
1370        End Get
1371        Set(ByVal value As Integer)
1372            Me("displayindex5") = value
1373        End Set
1374    End Property
1375
1376    <ConfigurationProperty("postctrlenter", DefaultValue:=False)> _
1377    Public Property PostCtrlEnter() As Boolean
1378        Get
1379            Return CBool(Me("postctrlenter"))
1380        End Get
1381        Set(ByVal value As Boolean)
1382            Me("postctrlenter") = value
1383        End Set
1384    End Property
1385
1386    <ConfigurationProperty("useapi", DefaultValue:=False)> _
1387    Public Property UseAPI() As Boolean
1388        Get
1389            Return CBool(Me("useapi"))
1390        End Get
1391        Set(ByVal value As Boolean)
1392            Me("useapi") = value
1393        End Set
1394    End Property
1395
1396    <ConfigurationProperty("checkreply", DefaultValue:=True)> _
1397    Public Property CheckReply() As Boolean
1398        Get
1399            Return CBool(Me("checkreply"))
1400        End Get
1401        Set(ByVal value As Boolean)
1402            Me("checkreply") = value
1403        End Set
1404    End Property
1405
1406    <ConfigurationProperty("userecommendstatus", DefaultValue:=False)> _
1407    Public Property UseRecommendStatus() As Boolean
1408        Get
1409            Return CBool(Me("userecommendstatus"))
1410        End Get
1411        Set(ByVal value As Boolean)
1412            Me("userecommendstatus") = value
1413        End Set
1414    End Property
1415
1416    <ConfigurationProperty("dispusername", DefaultValue:=False)> _
1417    Public Property DispUsername() As Boolean
1418        Get
1419            Return CBool(Me("dispusername"))
1420        End Get
1421        Set(ByVal value As Boolean)
1422            Me("dispusername") = value
1423        End Set
1424    End Property
1425
1426    <ConfigurationProperty("minimizetotray", DefaultValue:=False)> _
1427    Public Property MinimizeToTray() As Boolean
1428        Get
1429            Return CBool(Me("minimizetotray"))
1430        End Get
1431        Set(ByVal value As Boolean)
1432            Me("minimizetotray") = value
1433        End Set
1434    End Property
1435
1436    <ConfigurationProperty("closetoexit", DefaultValue:=False)> _
1437Public Property CloseToExit() As Boolean
1438        Get
1439            Return CBool(Me("closetoexit"))
1440        End Get
1441        Set(ByVal value As Boolean)
1442            Me("closetoexit") = value
1443        End Set
1444    End Property
1445
1446    <ConfigurationProperty("displatestpost", DefaultValue:=DispTitleEnum.Post)> _
1447    Public Property DispLatestPost() As DispTitleEnum
1448        Get
1449            Return DirectCast(Me("displatestpost"), DispTitleEnum)
1450        End Get
1451        Set(ByVal value As DispTitleEnum)
1452            Me("displatestpost") = value
1453        End Set
1454    End Property
1455
1456    <ConfigurationProperty("hubserver", DefaultValue:="twitter.com")> _
1457    Public Property HubServer() As String
1458        Get
1459            Return CStr(Me("hubserver"))
1460        End Get
1461        Set(ByVal value As String)
1462            Me("hubserver") = value
1463        End Set
1464    End Property
1465
1466    <ConfigurationProperty("browserpath", DefaultValue:="")> _
1467    Public Property BrowserPath() As String
1468        Get
1469            Return CStr(Me("browserpath"))
1470        End Get
1471        Set(ByVal value As String)
1472            Me("browserpath") = value
1473        End Set
1474    End Property
1475
1476    <ConfigurationProperty("sortorderlock", DefaultValue:=False)> _
1477    Public Property SortOrderLock() As Boolean
1478        Get
1479            Return CBool(Me("sortorderlock"))
1480        End Get
1481        Set(ByVal value As Boolean)
1482            Me("sortorderlock") = value
1483        End Set
1484    End Property
1485
1486    <ConfigurationProperty("tinyurlresolve", DefaultValue:=True)> _
1487    Public Property TinyURLResolve() As Boolean
1488        Get
1489            Return CBool(Me("tinyurlresolve"))
1490        End Get
1491        Set(ByVal value As Boolean)
1492            Me("tinyurlresolve") = value
1493        End Set
1494    End Property
1495
1496    <ConfigurationProperty("proxytype", DefaultValue:=ProxyTypeEnum.IE)> _
1497    Public Property ProxyType() As ProxyTypeEnum
1498        Get
1499            Return DirectCast(Me("proxytype"), ProxyTypeEnum)
1500        End Get
1501        Set(ByVal value As ProxyTypeEnum)
1502            Me("proxytype") = value
1503        End Set
1504    End Property
1505
1506    <ConfigurationProperty("proxyaddress", DefaultValue:="127.0.0.1")> _
1507    Public Property ProxyAddress() As String
1508        Get
1509            Return Me("proxyaddress").ToString
1510        End Get
1511        Set(ByVal value As String)
1512            Me("proxyaddress") = value
1513        End Set
1514    End Property
1515
1516    <ConfigurationProperty("proxyport", DefaultValue:=80)> _
1517    Public Property ProxyPort() As Integer
1518        Get
1519            Return DirectCast(Me("proxyport"), Integer)
1520        End Get
1521        Set(ByVal value As Integer)
1522            Me("proxyport") = value
1523        End Set
1524    End Property
1525
1526    <ConfigurationProperty("proxyuser", DefaultValue:="")> _
1527    Public Property ProxyUser() As String
1528        Get
1529            Return Me("proxyuser").ToString
1530        End Get
1531        Set(ByVal value As String)
1532            Me("proxyuser") = value
1533        End Set
1534    End Property
1535
1536    <ConfigurationProperty("proxypassword", DefaultValue:="")> _
1537    Public Property ProxyPassword() As String
1538        Get
1539            Dim pwd As String = ""
1540            If CStr(Me("proxypassword")).Length > 0 Then
1541                Try
1542                    pwd = DecryptString(CStr(Me("proxypassword")))
1543                Catch ex As Exception
1544                    pwd = ""
1545                End Try
1546            End If
1547            Return pwd
1548        End Get
1549        Set(ByVal value As String)
1550            Dim pwd As String = value.Trim()
1551            If pwd.Length > 0 Then
1552                Try
1553                    Me("proxypassword") = EncryptString(value)
1554                Catch ex As Exception
1555                    Me("proxypassword") = ""
1556                End Try
1557            Else
1558                Me("proxypassword") = ""
1559            End If
1560        End Set
1561    End Property
1562
1563    <ConfigurationProperty("periodadjust", DefaultValue:=True)> _
1564    Public Property PeriodAdjust() As Boolean
1565        Get
1566            Return CBool(Me("periodadjust"))
1567        End Get
1568        Set(ByVal value As Boolean)
1569            Me("periodadjust") = value
1570        End Set
1571    End Property
1572
1573    <ConfigurationProperty("startupversion", DefaultValue:=True)> _
1574    Public Property StartupVersion() As Boolean
1575        Get
1576            Return CBool(Me("startupversion"))
1577        End Get
1578        Set(ByVal value As Boolean)
1579            Me("startupversion") = value
1580        End Set
1581    End Property
1582
1583    <ConfigurationProperty("startupkey", DefaultValue:=True)> _
1584    Public Property StartupKey() As Boolean
1585        Get
1586            Return CBool(Me("startupkey"))
1587        End Get
1588        Set(ByVal value As Boolean)
1589            Me("startupkey") = value
1590        End Set
1591    End Property
1592
1593    <ConfigurationProperty("startupfollowers", DefaultValue:=True)> _
1594    Public Property StartupFollowers() As Boolean
1595        Get
1596            Return CBool(Me("startupfollowers"))
1597        End Get
1598        Set(ByVal value As Boolean)
1599            Me("startupfollowers") = value
1600        End Set
1601    End Property
1602
1603    <ConfigurationProperty("restrictfavcheck", DefaultValue:=False)> _
1604    Public Property RestrictFavCheck() As Boolean
1605        Get
1606            Return CBool(Me("restrictfavcheck"))
1607        End Get
1608        Set(ByVal value As Boolean)
1609            Me("restrictfavcheck") = value
1610        End Set
1611    End Property
1612
1613    <ConfigurationProperty("alwaystop", DefaultValue:=False)> _
1614    Public Property AlwaysTop() As Boolean
1615        Get
1616            Return CBool(Me("alwaystop"))
1617        End Get
1618        Set(ByVal value As Boolean)
1619            Me("alwaystop") = value
1620        End Set
1621    End Property
1622
1623    <ConfigurationProperty("statusmultiline", DefaultValue:=False)> _
1624    Public Property StatusMultiline() As Boolean
1625        Get
1626            Return CBool(Me("statusmultiline"))
1627        End Get
1628        Set(ByVal value As Boolean)
1629            Me("statusmultiline") = value
1630        End Set
1631    End Property
1632
1633    <ConfigurationProperty("statustextheight", DefaultValue:=38)> _
1634    Public Property StatusTextHeight() As Integer
1635        Get
1636            Return CInt(Me("statustextheight"))
1637        End Get
1638        Set(ByVal value As Integer)
1639            Me("statustextheight") = value
1640        End Set
1641    End Property
1642
1643    Private Function EncryptString(ByVal str As String) As String
1644        '文字列をバイト型配列にする
1645        Dim bytesIn As Byte() = System.Text.Encoding.UTF8.GetBytes(str)
1646
1647        'DESCryptoServiceProviderオブジェクトの作成
1648        Dim des As New System.Security.Cryptography.DESCryptoServiceProvider
1649
1650        '共有キーと初期化ベクタを決定
1651        'パスワードをバイト配列にする
1652        Dim bytesKey As Byte() = System.Text.Encoding.UTF8.GetBytes("_tween_encrypt_key_")
1653        '共有キーと初期化ベクタを設定
1654        des.Key = ResizeBytesArray(bytesKey, des.Key.Length)
1655        des.IV = ResizeBytesArray(bytesKey, des.IV.Length)
1656
1657        '暗号化されたデータを書き出すためのMemoryStream
1658        Using msOut As New System.IO.MemoryStream
1659            'DES暗号化オブジェクトの作成
1660            Using desdecrypt As System.Security.Cryptography.ICryptoTransform = _
1661                des.CreateEncryptor()
1662
1663                '書き込むためのCryptoStreamの作成
1664                Using cryptStream As New System.Security.Cryptography.CryptoStream( _
1665                    msOut, desdecrypt, _
1666                    System.Security.Cryptography.CryptoStreamMode.Write)
1667                    '書き込む
1668                    cryptStream.Write(bytesIn, 0, bytesIn.Length)
1669                    cryptStream.FlushFinalBlock()
1670                    '暗号化されたデータを取得
1671                    Dim bytesOut As Byte() = msOut.ToArray()
1672
1673                    '閉じる
1674                    cryptStream.Close()
1675                    msOut.Close()
1676
1677                    'Base64で文字列に変更して結果を返す
1678                    Return System.Convert.ToBase64String(bytesOut)
1679                End Using
1680            End Using
1681        End Using
1682    End Function
1683
1684    Private Function DecryptString(ByVal str As String) As String
1685        'DESCryptoServiceProviderオブジェクトの作成
1686        Dim des As New System.Security.Cryptography.DESCryptoServiceProvider
1687
1688        '共有キーと初期化ベクタを決定
1689        'パスワードをバイト配列にする
1690        Dim bytesKey As Byte() = System.Text.Encoding.UTF8.GetBytes("_tween_encrypt_key_")
1691        '共有キーと初期化ベクタを設定
1692        des.Key = ResizeBytesArray(bytesKey, des.Key.Length)
1693        des.IV = ResizeBytesArray(bytesKey, des.IV.Length)
1694
1695        'Base64で文字列をバイト配列に戻す
1696        Dim bytesIn As Byte() = System.Convert.FromBase64String(str)
1697        '暗号化されたデータを読み込むためのMemoryStream
1698        Using msIn As New System.IO.MemoryStream(bytesIn)
1699            'DES復号化オブジェクトの作成
1700            Using desdecrypt As System.Security.Cryptography.ICryptoTransform = _
1701                des.CreateDecryptor()
1702                '読み込むためのCryptoStreamの作成
1703                Using cryptStreem As New System.Security.Cryptography.CryptoStream( _
1704                    msIn, desdecrypt, _
1705                    System.Security.Cryptography.CryptoStreamMode.Read)
1706
1707                    '復号化されたデータを取得するためのStreamReader
1708                    Using srOut As New System.IO.StreamReader( _
1709                        cryptStreem, System.Text.Encoding.UTF8)
1710                        '復号化されたデータを取得する
1711                        Dim result As String = srOut.ReadToEnd()
1712
1713                        '閉じる
1714                        srOut.Close()
1715                        cryptStreem.Close()
1716                        msIn.Close()
1717
1718                        Return result
1719                    End Using
1720                End Using
1721            End Using
1722        End Using
1723    End Function
1724
1725    Private Shared Function ResizeBytesArray(ByVal bytes() As Byte, _
1726                                ByVal newSize As Integer) As Byte()
1727        Dim newBytes(newSize - 1) As Byte
1728        If bytes.Length <= newSize Then
1729            Dim i As Integer
1730            For i = 0 To bytes.Length - 1
1731                newBytes(i) = bytes(i)
1732            Next i
1733        Else
1734            Dim pos As Integer = 0
1735            Dim i As Integer
1736            For i = 0 To bytes.Length - 1
1737                newBytes(pos) = newBytes(pos) Xor bytes(i)
1738                pos += 1
1739                If pos >= newBytes.Length Then
1740                    pos = 0
1741                End If
1742            Next i
1743        End If
1744        Return newBytes
1745    End Function
1746End Class
Note: See TracBrowser for help on using the browser.