Changeset 24566

Show
Ignore:
Timestamp:
11/21/08 18:43:14 (7 weeks ago)
Author:
kiri_feather
Message:

configに変な値が入る場合があるための対策を一部

Location:
lang/vb2005/Tween/Tween
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/vb2005/Tween/Tween/TwConfig.vb

    r23890 r24566  
    889889    Public Property SplitterDistance() As Integer 
    890890        Get 
    891             Return CInt(Me("splitterdistance")) 
    892         End Get 
    893         Set(ByVal value As Integer) 
     891            Dim dis As Integer = DirectCast(Me("splitterdistance"), Integer) 
     892            If dis < 0 Then dis = 320 
     893            Return dis 
     894        End Get 
     895        Set(ByVal value As Integer) 
     896            If value < 0 Then value = 320 
    894897            Me("splitterdistance") = value 
    895898        End Set 
     
    899902    Public Property FormSize() As Size 
    900903        Get 
    901             Return CType(Me("formsize"), Size) 
     904            Dim sz As Size = CType(Me("formsize"), Size) 
     905            If sz.Height < 0 Then sz.Height = 476 
     906            If sz.Width < 0 Then sz.Width = 436 
     907            Return sz 
    902908        End Get 
    903909        Set(ByVal value As Size) 
    904             Me("formsize") = value 
     910            Dim sz As Size = value 
     911            If sz.Height < 0 Then sz.Height = 476 
     912            If sz.Width < 0 Then sz.Width = 436 
     913            Me("formsize") = sz 
    905914        End Set 
    906915    End Property 
     
    15511560            If pwd.Length > 0 Then 
    15521561                Try 
    1553                     Me("proxypassword") = EncryptString(value) 
     1562                    Me("proxypassword") = EncryptString(pwd) 
    15541563                Catch ex As Exception 
    15551564                    Me("proxypassword") = "" 
  • lang/vb2005/Tween/Tween/Tween.vb

    r24555 r24566  
    70307030 
    70317031    Private Sub SplitContainer1_SplitterMoved(ByVal sender As Object, ByVal e As System.Windows.Forms.SplitterEventArgs) Handles SplitContainer1.SplitterMoved 
    7032         _mySpDis = SplitContainer1.SplitterDistance 
     7032        If Me.WindowState = FormWindowState.Normal Then _mySpDis = SplitContainer1.SplitterDistance 
    70337033    End Sub 
    70347034