From ab7bf2fc996d8740def60be8d6faea6640422de7 Mon Sep 17 00:00:00 2001 From: kiri_feather Date: Fri, 3 Dec 2010 14:48:26 +0000 Subject: [PATCH] =?utf8?q?US=E5=8F=97=E4=BF=A1=E3=81=A7=E7=99=BA=E8=A8=80I?= =?utf8?q?D=E9=A0=86=E3=81=AE=E6=99=82=E3=81=AF=E3=82=BD=E3=83=BC=E3=83=88?= =?utf8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89?= =?utf8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@1161 e39ad16e-3079-482e-bb30-4b4d378143b6 --- Tween/StatusDictionary.vb | 17 ++++++++++++++--- Tween/Tween.vb | 10 +++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Tween/StatusDictionary.vb b/Tween/StatusDictionary.vb index cdf27926..bc9c9c4d 100644 --- a/Tween/StatusDictionary.vb +++ b/Tween/StatusDictionary.vb @@ -789,7 +789,7 @@ Public NotInheritable Class TabInformations End SyncLock End Function - Public Function SubmitUpdate(ByRef soundFile As String, ByRef notifyPosts As PostClass(), ByRef isMentionIncluded As Boolean) As Integer + Public Function SubmitUpdate(ByRef soundFile As String, ByRef notifyPosts As PostClass(), ByRef isMentionIncluded As Boolean, ByVal isUserStream As Boolean) As Integer '注:メインスレッドから呼ぶこと SyncLock LockObj If _notifyPosts Is Nothing Then @@ -804,7 +804,9 @@ Public NotInheritable Class TabInformations End If tb.AddSubmit(isMentionIncluded) '振分確定(各タブに反映) Next - Me.SortPosts() + If Not isUserStream OrElse Me.SortMode <> IdComparerClass.ComparerMode.Id Then + Me.SortPosts() + End If soundFile = _soundFile _soundFile = "" @@ -1571,7 +1573,15 @@ Public NotInheritable Class TabClass Private Sub Add(ByVal ID As Long, ByVal Read As Boolean) If Me._ids.Contains(ID) Then Exit Sub - Me._ids.Add(ID) + If Me.Sorter.Mode = IdComparerClass.ComparerMode.Id Then + If Me.Sorter.Order = SortOrder.Ascending Then + Me._ids.Add(ID) + Else + Me._ids.Insert(0, ID) + End If + Else + Me._ids.Add(ID) + End If If Not Read AndAlso Me._unreadManage Then Me._unreadCount += 1 @@ -1630,6 +1640,7 @@ Public NotInheritable Class TabClass Public Sub AddSubmit(ByRef isMentionIncluded As Boolean) If _tmpIds.Count = 0 Then Exit Sub + _tmpIds.Sort(Function(x As TemporaryId, y As TemporaryId) x.Id.CompareTo(y.Id)) For Each tId As TemporaryId In _tmpIds If Me.TabType = TabUsageType.Mentions AndAlso TabInformations.GetInstance.Item(tId.Id).IsReply Then isMentionIncluded = True Me.Add(tId.Id, tId.Read) diff --git a/Tween/Tween.vb b/Tween/Tween.vb index 699bc6b3..ee49597b 100644 --- a/Tween/Tween.vb +++ b/Tween/Tween.vb @@ -1225,7 +1225,7 @@ Public Class TweenMain #End If End Sub - Private Sub RefreshTimeline() + Private Sub RefreshTimeline(ByVal isUserStream As Boolean) 'スクロール制御準備 Dim smode As Integer = -1 '-1:制御しない,-2:最新へ,その他:topitem使用 Dim topId As Long = GetScrollPos(smode) @@ -1244,7 +1244,7 @@ Public Class TweenMain Dim soundFile As String = "" Dim addCount As Integer = 0 Dim isMention As Boolean = False - addCount = _statuses.SubmitUpdate(soundFile, notifyPosts, isMention) + addCount = _statuses.SubmitUpdate(soundFile, notifyPosts, isMention, isUserStream) If _endingFlag Then Exit Sub @@ -2288,7 +2288,7 @@ Public Class TweenMain rslt.type = WORKERTYPE.FavAdd OrElse _ rslt.type = WORKERTYPE.FavRemove OrElse _ rslt.type = WORKERTYPE.Related Then - RefreshTimeline() 'リスト反映 + RefreshTimeline(False) 'リスト反映 End If Select Case rslt.type @@ -9792,7 +9792,7 @@ RETRY: For Each tb As TabPage In ListTab.TabPages DirectCast(tb.Tag, DetailsListView).VirtualListSize = _statuses.Tabs(tb.Text).AllCount Next - Me.RefreshTimeline() + Me.RefreshTimeline(True) End Sub Private Sub tw_NewPostFromStream() @@ -9830,7 +9830,7 @@ RETRY: Try If InvokeRequired AndAlso Not IsDisposed Then - Invoke(New MethodInvoker(AddressOf RefreshTimeline)) + Invoke(New Action(Of Boolean)(AddressOf RefreshTimeline), True) Exit Sub End If Catch ex As ObjectDisposedException -- 2.11.0