svnno****@sourc*****
svnno****@sourc*****
2011年 2月 28日 (月) 21:08:36 JST
Revision: 1475 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1475 Author: kiri_feather Date: 2011-02-28 21:08:36 +0900 (Mon, 28 Feb 2011) Log Message: ----------- 画像取得時の画像検証で例外発生時は新規ビットマップを返すよう変更 アイコン画像取得失敗時に新規ビットマップで代替するのをやめた 仮想リストビューの選択状態クリアが一度で効かない場合があるので対処 RemovePost整理 LView.Items(Index).Selected = Trueへ戻し。 Modified Paths: -------------- trunk/Tween/Connection/HttpVarious.vb trunk/Tween/HashtagManage.vb trunk/Tween/ImageDictionary.vb trunk/Tween/StatusDictionary.vb trunk/Tween/Tween.vb -------------- next part -------------- Modified: trunk/Tween/Connection/HttpVarious.vb =================================================================== --- trunk/Tween/Connection/HttpVarious.vb 2011-02-28 03:39:55 UTC (rev 1474) +++ trunk/Tween/Connection/HttpVarious.vb 2011-02-28 12:08:36 UTC (rev 1475) @@ -193,17 +193,23 @@ Public Overloads Function CheckValidImage(ByVal img As Image, ByVal width As Integer, ByVal height As Integer) As Image If img Is Nothing Then Return Nothing - Dim bmp As New Bitmap(width, height) - Dim tag As Object = img.Tag - Using g As Graphics = Graphics.FromImage(bmp) - g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic - g.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality - g.DrawImage(img, 0, 0, width, height) - End Using - img.Dispose() - bmp.Tag = tag - Return bmp + Try + Using g As Graphics = Graphics.FromImage(bmp) + g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic + g.PixelOffsetMode = Drawing2D.PixelOffsetMode.HighQuality + g.DrawImage(img, 0, 0, width, height) + End Using + bmp.Tag = img.Tag + Return bmp + Catch ex As Exception + bmp.Dispose() + bmp = New Bitmap(width, height) + bmp.Tag = img.Tag + Return bmp + Finally + img.Dispose() + End Try End Function End Class Modified: trunk/Tween/HashtagManage.vb =================================================================== --- trunk/Tween/HashtagManage.vb 2011-02-28 03:39:55 UTC (rev 1474) +++ trunk/Tween/HashtagManage.vb 2011-02-28 12:08:36 UTC (rev 1475) @@ -82,7 +82,9 @@ End Sub Private Sub UnSelectButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UnSelectButton.Click - HistoryHashList.SelectedIndices.Clear() + Do + HistoryHashList.SelectedIndices.Clear() + Loop While HistoryHashList.SelectedIndices.Count > 0 End Sub Private Function GetIndexOf(ByVal list As ListBox.ObjectCollection, ByVal value As String) As Integer @@ -252,12 +254,16 @@ If Not Me._isAdd AndAlso Me.HistoryHashList.SelectedIndices.Count > 0 Then idx = Me.HistoryHashList.SelectedIndices(0) Me.HistoryHashList.Items.RemoveAt(idx) - Me.HistoryHashList.SelectedIndices.Clear() + Do + Me.HistoryHashList.SelectedIndices.Clear() + Loop While Me.HistoryHashList.SelectedIndices.Count > 0 Me.HistoryHashList.Items.Insert(idx, hashStr) Me.HistoryHashList.SelectedIndex = idx Else Me.AddHashToHistory(hashStr, False) - Me.HistoryHashList.SelectedIndices.Clear() + Do + Me.HistoryHashList.SelectedIndices.Clear() + Loop While Me.HistoryHashList.SelectedIndices.Count > 0 Me.HistoryHashList.SelectedIndex = Me.HistoryHashList.Items.IndexOf(hashStr) End If Modified: trunk/Tween/ImageDictionary.vb =================================================================== --- trunk/Tween/ImageDictionary.vb 2011-02-28 03:39:55 UTC (rev 1474) +++ trunk/Tween/ImageDictionary.vb 2011-02-28 12:08:36 UTC (rev 1475) @@ -275,7 +275,6 @@ Dim callbackImage As Image = Nothing SyncLock lockObject If Me.innerDictionary(downloadAsyncInfo.Key) IsNot Nothing Then - 'callbackImage = New Bitmap(DirectCast(Me.innerDictionary(downloadAsyncInfo.Key), Image)) callbackImage = DirectCast(Me.innerDictionary(downloadAsyncInfo.Key), Image) End If End SyncLock @@ -290,13 +289,9 @@ If Me.innerDictionary(downloadAsyncInfo.Key) Is Nothing Then If dlImage IsNot Nothing Then Me.innerDictionary.Add(downloadAsyncInfo.Key, dlImage, Me.cachePolicy) - 'callbackImage = New Bitmap(dlImage) callbackImage = dlImage - Else - Me.innerDictionary.Add(downloadAsyncInfo.Key, New Bitmap(16, 16), Me.cachePolicy) End If Else - 'callbackImage = New Bitmap(DirectCast(Me.innerDictionary(downloadAsyncInfo.Key), Image)) callbackImage = DirectCast(Me.innerDictionary(downloadAsyncInfo.Key), Image) End If End SyncLock Modified: trunk/Tween/StatusDictionary.vb =================================================================== --- trunk/Tween/StatusDictionary.vb 2011-02-28 03:39:55 UTC (rev 1474) +++ trunk/Tween/StatusDictionary.vb 2011-02-28 12:08:36 UTC (rev 1475) @@ -687,7 +687,7 @@ For Each key As String In _tabs.Keys Dim tab As TabClass = _tabs(key) If tab.Contains(Id) Then - If tab.Posts.Count = 0 Then + If Not tab.IsInnerStorageTabType Then If tab.UnreadManage AndAlso Not post.IsRead Then '未読管理 SyncLock LockUnread tab.UnreadCount -= 1 @@ -695,8 +695,7 @@ End SyncLock End If Else '未読数がずれる可能性があるためtab.Postsの未読も確認する - Dim tabPost As PostClass = tab.Posts(Id) - If tab.UnreadManage AndAlso Not tabPost.IsRead Then '未読管理 + If tab.UnreadManage AndAlso Not tab.Posts(Id).IsRead Then '未読管理 SyncLock LockUnread tab.UnreadCount -= 1 Me.SetNextUnreadId(Id, tab) @@ -708,18 +707,6 @@ Next _statuses.Remove(Id) End If - For Each tb As TabClass In _tabs.Values - If tb.IsInnerStorageTabType AndAlso tb.Contains(Id) Then - post = tb.Posts(Id) - If tb.UnreadManage AndAlso Not post.IsRead Then - SyncLock LockUnread - tb.UnreadCount -= 1 - Me.SetNextUnreadId(Id, tb) - End SyncLock - End If - tb.Remove(Id) - End If - Next End SyncLock End Sub Modified: trunk/Tween/Tween.vb =================================================================== --- trunk/Tween/Tween.vb 2011-02-28 03:39:55 UTC (rev 1474) +++ trunk/Tween/Tween.vb 2011-02-28 12:08:36 UTC (rev 1475) @@ -2475,7 +2475,9 @@ End If Next If _curTab.Text.Equals(favTabName) Then - _curList.SelectedIndices.Clear() + Do + _curList.SelectedIndices.Clear() + Loop While _curList.SelectedIndices.Count > 0 If _statuses.Tabs(favTabName).AllCount > 0 Then If _statuses.Tabs(favTabName).AllCount - 1 > fidx AndAlso fidx > -1 Then _curList.SelectedIndices.Add(fidx) @@ -2876,7 +2878,9 @@ For Each tb As TabPage In ListTab.TabPages DirectCast(tb.Tag, DetailsListView).VirtualListSize = _statuses.Tabs(tb.Text).AllCount If _curTab.Equals(tb) Then - _curList.SelectedIndices.Clear() + Do + _curList.SelectedIndices.Clear() + Loop While _curList.SelectedIndices.Count > 0 If _statuses.Tabs(tb.Text).AllCount > 0 Then If _statuses.Tabs(tb.Text).AllCount - 1 > fidx AndAlso fidx > -1 Then _curList.SelectedIndices.Add(fidx) @@ -8230,9 +8234,11 @@ flg = True End If - LView.SelectedIndices.Clear() - 'LView.Items(Index).Selected = True - LView.SelectedIndices.Add(Index) + Do + LView.SelectedIndices.Clear() + Loop While LView.SelectedIndices.Count > 0 + LView.Items(Index).Selected = True + 'LView.SelectedIndices.Add(Index) LView.Items(Index).Focused = True If flg Then LView.Invalidate(bnd) @@ -8249,7 +8255,9 @@ Dim fIdx As Integer = -1 If Index IsNot Nothing AndAlso Not (Index.Count = 1 AndAlso Index(0) = -1) Then - LView.SelectedIndices.Clear() + Do + LView.SelectedIndices.Clear() + Loop While LView.SelectedIndices.Count > 0 For Each idx As Integer In Index If idx > -1 AndAlso LView.VirtualListSize > idx Then LView.SelectedIndices.Add(idx)