From 1254c5279ad4d7f74642504b9c7f5f4f16ac5201 Mon Sep 17 00:00:00 2001 From: kiri_feather Date: Mon, 28 Feb 2011 12:08:36 +0000 Subject: [PATCH] =?utf8?q?=E7=94=BB=E5=83=8F=E5=8F=96=E5=BE=97=E6=99=82?= =?utf8?q?=E3=81=AE=E7=94=BB=E5=83=8F=E6=A4=9C=E8=A8=BC=E3=81=A7=E4=BE=8B?= =?utf8?q?=E5=A4=96=E7=99=BA=E7=94=9F=E6=99=82=E3=81=AF=E6=96=B0=E8=A6=8F?= =?utf8?q?=E3=83=93=E3=83=83=E3=83=88=E3=83=9E=E3=83=83=E3=83=97=E3=82=92?= =?utf8?q?=E8=BF=94=E3=81=99=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4=20?= =?utf8?q?=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3=E7=94=BB=E5=83=8F=E5=8F=96?= =?utf8?q?=E5=BE=97=E5=A4=B1=E6=95=97=E6=99=82=E3=81=AB=E6=96=B0=E8=A6=8F?= =?utf8?q?=E3=83=93=E3=83=83=E3=83=88=E3=83=9E=E3=83=83=E3=83=97=E3=81=A7?= =?utf8?q?=E4=BB=A3=E6=9B=BF=E3=81=99=E3=82=8B=E3=81=AE=E3=82=92=E3=82=84?= =?utf8?q?=E3=82=81=E3=81=9F=20=E4=BB=AE=E6=83=B3=E3=83=AA=E3=82=B9?= =?utf8?q?=E3=83=88=E3=83=93=E3=83=A5=E3=83=BC=E3=81=AE=E9=81=B8=E6=8A=9E?= =?utf8?q?=E7=8A=B6=E6=85=8B=E3=82=AF=E3=83=AA=E3=82=A2=E3=81=8C=E4=B8=80?= =?utf8?q?=E5=BA=A6=E3=81=A7=E5=8A=B9=E3=81=8B=E3=81=AA=E3=81=84=E5=A0=B4?= =?utf8?q?=E5=90=88=E3=81=8C=E3=81=82=E3=82=8B=E3=81=AE=E3=81=A7=E5=AF=BE?= =?utf8?q?=E5=87=A6=20RemovePost=E6=95=B4=E7=90=86=20LView.Items(Index).Se?= =?utf8?q?lected=20=3D=20True=E3=81=B8=E6=88=BB=E3=81=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@1475 e39ad16e-3079-482e-bb30-4b4d378143b6 --- Tween/Connection/HttpVarious.vb | 26 ++++++++++++++++---------- Tween/HashtagManage.vb | 12 +++++++++--- Tween/ImageDictionary.vb | 5 ----- Tween/StatusDictionary.vb | 17 ++--------------- Tween/Tween.vb | 20 ++++++++++++++------ 5 files changed, 41 insertions(+), 39 deletions(-) diff --git a/Tween/Connection/HttpVarious.vb b/Tween/Connection/HttpVarious.vb index 322108d4..accd0765 100644 --- a/Tween/Connection/HttpVarious.vb +++ b/Tween/Connection/HttpVarious.vb @@ -193,17 +193,23 @@ Public Class HttpVarious 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 diff --git a/Tween/HashtagManage.vb b/Tween/HashtagManage.vb index 70923991..a3983305 100644 --- a/Tween/HashtagManage.vb +++ b/Tween/HashtagManage.vb @@ -82,7 +82,9 @@ Public Class HashtagManage 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 @@ Public Class HashtagManage 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 diff --git a/Tween/ImageDictionary.vb b/Tween/ImageDictionary.vb index 5d927bd1..a7cd999d 100644 --- a/Tween/ImageDictionary.vb +++ b/Tween/ImageDictionary.vb @@ -275,7 +275,6 @@ Public Class ImageDictionary 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 @@ Public Class ImageDictionary 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 diff --git a/Tween/StatusDictionary.vb b/Tween/StatusDictionary.vb index 76740b92..13fa19a9 100644 --- a/Tween/StatusDictionary.vb +++ b/Tween/StatusDictionary.vb @@ -687,7 +687,7 @@ Public NotInheritable Class TabInformations 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 @@ Public NotInheritable Class TabInformations 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 @@ Public NotInheritable Class TabInformations 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 diff --git a/Tween/Tween.vb b/Tween/Tween.vb index 522b953a..23b3232f 100644 --- a/Tween/Tween.vb +++ b/Tween/Tween.vb @@ -2475,7 +2475,9 @@ Public Class TweenMain 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 @@ Public Class TweenMain 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 @@ RETRY: 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 @@ RETRY: 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) -- 2.11.0