Changeset 34029

Show
Ignore:
Timestamp:
06/18/09 17:53:25 (4 years ago)
Author:
kiri_feather
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/vb2005/Tween/branches/kiri/Tween/Tween.vb

    r34019 r34029  
    29202920            fndOpt = StringComparison.OrdinalIgnoreCase 
    29212921        End If 
     2922        Try 
    29222923RETRY: 
    2923         If UseRegex Then 
    2924             ' 正規表現検索 
    2925             Dim _search As Regex 
    2926             Try 
    2927                 _search = New Regex(_word) 
     2924            If UseRegex Then 
     2925                ' 正規表現検索 
     2926                Dim _search As Regex 
     2927                Try 
     2928                    _search = New Regex(_word) 
     2929                    For idx As Integer = cidx To toIdx Step stp 
     2930                        Dim post As PostClass = _statuses.Item(_curTab.Text, idx) 
     2931                        If _search.IsMatch(post.Nickname, regOpt) _ 
     2932                            OrElse _search.IsMatch(post.Data, regOpt) _ 
     2933                            OrElse _search.IsMatch(post.Name, regOpt) _ 
     2934                        Then 
     2935                            SelectListItem(_curList, idx) 
     2936                            _curList.EnsureVisible(idx) 
     2937                            Exit Sub 
     2938                        End If 
     2939                    Next 
     2940                Catch ex As ArgumentException 
     2941                    MsgBox(My.Resources.DoTabSearchText1, MsgBoxStyle.Critical) 
     2942                    Exit Sub 
     2943                End Try 
     2944            Else 
     2945                ' 通常検索 
    29282946                For idx As Integer = cidx To toIdx Step stp 
    29292947                    Dim post As PostClass = _statuses.Item(_curTab.Text, idx) 
    2930                     If _search.IsMatch(post.Nickname, regOpt) _ 
    2931                         OrElse _search.IsMatch(post.Data, regOpt) _ 
    2932                         OrElse _search.IsMatch(post.Name, regOpt) _ 
     2948                    If post.Nickname.IndexOf(_word, fndOpt) > -1 _ 
     2949                        OrElse post.Data.IndexOf(_word, fndOpt) > -1 _ 
     2950                        OrElse post.Name.IndexOf(_word, fndOpt) > -1 _ 
    29332951                    Then 
    29342952                        SelectListItem(_curList, idx) 
     
    29372955                    End If 
    29382956                Next 
    2939             Catch ex As ArgumentException 
    2940                 MsgBox(My.Resources.DoTabSearchText1, MsgBoxStyle.Critical) 
    2941                 Exit Sub 
    2942             End Try 
    2943         Else 
    2944             ' 通常検索 
    2945             For idx As Integer = cidx To toIdx Step stp 
    2946                 Dim post As PostClass = _statuses.Item(_curTab.Text, idx) 
    2947                 If post.Nickname.IndexOf(_word, fndOpt) > -1 _ 
    2948                     OrElse post.Data.IndexOf(_word, fndOpt) > -1 _ 
    2949                     OrElse post.Name.IndexOf(_word, fndOpt) > -1 _ 
    2950                 Then 
    2951                     SelectListItem(_curList, idx) 
    2952                     _curList.EnsureVisible(idx) 
    2953                     Exit Sub 
    2954                 End If 
    2955             Next 
    2956         End If 
    2957  
    2958         If Not fnd Then 
    2959             Select Case SType 
    2960                 Case SEARCHTYPE.DialogSearch, SEARCHTYPE.NextSearch 
    2961                     toIdx = cidx 
    2962                     cidx = 0 
    2963                 Case SEARCHTYPE.PrevSearch 
    2964                     toIdx = cidx 
    2965                     cidx = _curList.Items.Count - 1 
    2966             End Select 
    2967             fnd = True 
    2968             GoTo RETRY 
    2969         End If 
    2970  
     2957            End If 
     2958 
     2959            If Not fnd Then 
     2960                Select Case SType 
     2961                    Case SEARCHTYPE.DialogSearch, SEARCHTYPE.NextSearch 
     2962                        toIdx = cidx 
     2963                        cidx = 0 
     2964                    Case SEARCHTYPE.PrevSearch 
     2965                        toIdx = cidx 
     2966                        cidx = _curList.Items.Count - 1 
     2967                End Select 
     2968                fnd = True 
     2969                GoTo RETRY 
     2970            End If 
     2971        Catch ex As ArgumentOutOfRangeException 
     2972 
     2973        End Try 
    29712974        MessageBox.Show(My.Resources.DoTabSearchText2, My.Resources.DoTabSearchText3, MessageBoxButtons.OK, MessageBoxIcon.Information) 
    29722975    End Sub