<Serializable()> _
Public NotInheritable Class TabClass
Private _unreadManage As Boolean = False
- Private _notify As Boolean = False
- Private _soundFile As String = ""
Private _filters As List(Of FiltersClass)
- Private _oldestUnreadItem As Long = -1 'ID
Private _unreadCount As Integer = 0
Private _ids As List(Of Long)
- Private _filterMod As Boolean = False
Private _tmpIds As New List(Of TemporaryId)
- Private _tabName As String = ""
Private _tabType As TabUsageType = TabUsageType.Undefined
- Private _posts As New Dictionary(Of Long, PostClass)
Private _sorter As New IdComparerClass
- Private _oldestId As Long = Long.MaxValue '古いポスト取得用
- Private _sinceId As Long = 0
- Private _relationTargetPost As PostClass = Nothing
Private ReadOnly _lockObj As New Object
#End Region
<Xml.Serialization.XmlIgnore()> _
+ Public Property BackToTab() As TabClass
+
+ <Xml.Serialization.XmlIgnore()> _
Public Property RelationTargetPost() As PostClass
- Get
- Return _relationTargetPost
- End Get
- Set(ByVal value As PostClass)
- _relationTargetPost = value
- End Set
- End Property
<Xml.Serialization.XmlIgnore()> _
- Public Property OldestId() As Long
- Get
- Return _oldestId
- End Get
- Set(ByVal value As Long)
- _oldestId = value
- End Set
- End Property
+ Public Property OldestId() As Long = Long.MaxValue
<Xml.Serialization.XmlIgnore()> _
Public Property SinceId() As Long
- Get
- Return _sinceId
- End Get
- Set(ByVal value As Long)
- _sinceId = value
- End Set
- End Property
<Xml.Serialization.XmlIgnore()> _
- Public Property Posts() As Dictionary(Of Long, PostClass)
- Get
- Return _posts
- End Get
- Set(ByVal value As Dictionary(Of Long, PostClass))
- _posts = value
- End Set
- End Property
-
- 'Public Function SearchedPost(ByVal Id As Long) As PostClass
- ' If Not _posts.ContainsKey(Id) Then Return Nothing
- ' Return _posts(Id)
- 'End Function
+ Public Property Posts() As New Dictionary(Of Long, PostClass)
Public Function GetTemporaryPosts() As PostClass()
Dim tempPosts As New List(Of PostClass)
If _tmpIds.Count = 0 Then Return tempPosts.ToArray
For Each tempId As TemporaryId In _tmpIds
- tempPosts.Add(_posts(tempId.Id))
+ tempPosts.Add(_Posts(tempId.Id))
Next
Return tempPosts.ToArray
End Function
_soundFile = ""
_unreadManage = True
_ids = New List(Of Long)
- _oldestUnreadItem = -1
+ Me.OldestUnreadId = -1
_tabType = TabUsageType.Undefined
_listInfo = Nothing
End Sub
_soundFile = ""
_unreadManage = True
_ids = New List(Of Long)
- _oldestUnreadItem = -1
+ Me.OldestUnreadId = -1
_tabType = TabType
Me.ListInfo = list
If Me.IsInnerStorageTabType Then
If Not Read AndAlso Me._unreadManage Then
Me._unreadCount += 1
- If Me._oldestUnreadItem = -1 Then
- Me._oldestUnreadItem = ID
+ If Me.OldestUnreadId = -1 Then
+ Me.OldestUnreadId = ID
Else
- If ID < Me._oldestUnreadItem Then Me._oldestUnreadItem = ID
+ If ID < Me.OldestUnreadId Then Me.OldestUnreadId = ID
End If
End If
End Sub
If Not Read AndAlso Me._unreadManage Then
Me._unreadCount -= 1
- Me._oldestUnreadItem = -1
+ Me.OldestUnreadId = -1
End If
Me._ids.Remove(Id)
Set(ByVal value As Boolean)
Me._unreadManage = value
If Not value Then
- Me._oldestUnreadItem = -1
+ Me.OldestUnreadId = -1
Me._unreadCount = 0
End If
End Set
End Property
Public Property Notify() As Boolean
- Get
- Return _notify
- End Get
- Set(ByVal value As Boolean)
- _notify = value
- End Set
- End Property
- Public Property SoundFile() As String
- Get
- Return _soundFile
- End Get
- Set(ByVal value As String)
- _soundFile = value
- End Set
- End Property
+ Public Property SoundFile() As String = ""
<Xml.Serialization.XmlIgnore()> _
- Public Property OldestUnreadId() As Long
- Get
- Return _oldestUnreadItem
- End Get
- Set(ByVal value As Long)
- _oldestUnreadItem = value
- End Set
- End Property
+ Public Property OldestUnreadId() As Long = -1
<Xml.Serialization.XmlIgnore()> _
Public Property UnreadCount() As Integer
Public Sub RemoveFilter(ByVal filter As FiltersClass)
SyncLock Me._lockObj
_filters.Remove(filter)
- _filterMod = True
+ Me.FilterModified = True
End SyncLock
End Sub
SyncLock Me._lockObj
If _filters.Contains(filter) Then Return False
_filters.Add(filter)
- _filterMod = True
+ Me.FilterModified = True
Return True
End SyncLock
End Function
original.ExSource = modified.ExSource
original.MoveFrom = modified.MoveFrom
original.SetMark = modified.SetMark
- _filterMod = True
+ Me.FilterModified = True
End Sub
<Xml.Serialization.XmlIgnore()> _
_ids.Clear()
_tmpIds.Clear()
_unreadCount = 0
- _oldestUnreadItem = -1
+ Me.OldestUnreadId = -1
If _posts IsNot Nothing Then
_posts.Clear()
End If
<Xml.Serialization.XmlIgnore()> _
Public Property FilterModified() As Boolean
- Get
- Return _filterMod
- End Get
- Set(ByVal value As Boolean)
- _filterMod = value
- End Set
- End Property
Public Function BackupIds() As Long()
Return _ids.ToArray()
End Function
- Public Property TabName() As String
- Get
- Return _tabName
- End Get
- Set(ByVal value As String)
- _tabName = value
- End Set
- End Property
+ Public Property TabName() As String = ""
Public Property TabType() As TabUsageType
Get
Return True
End Function
- Public Function RemoveSpecifiedTab(ByVal TabName As String) As Boolean
+ Public Function RemoveSpecifiedTab(ByVal TabName As String, ByVal confirm As Boolean) As Boolean
Dim idx As Integer = 0
For idx = 0 To ListTab.TabPages.Count - 1
If ListTab.TabPages(idx).Text = TabName Then Exit For
If _statuses.IsDefaultTab(TabName) Then Return False
- Dim tmp As String = String.Format(My.Resources.RemoveSpecifiedTabText1, Environment.NewLine)
- If MessageBox.Show(tmp, TabName + " " + My.Resources.RemoveSpecifiedTabText2, _
- MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.Cancel Then
- Return False
+ If confirm Then
+ Dim tmp As String = String.Format(My.Resources.RemoveSpecifiedTabText1, Environment.NewLine)
+ If MessageBox.Show(tmp, TabName + " " + My.Resources.RemoveSpecifiedTabText2, _
+ MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.Cancel Then
+ Return False
+ End If
End If
SetListProperty() '他のタブに列幅等を反映
e.Handled = True
e.SuppressKeyPress = True
GetTimeline(WORKERTYPE.DirectMessegeRcv, 1, 0, "")
+ ElseIf e.KeyCode = Keys.Escape Then
+ If ListTab.SelectedTab IsNot Nothing AndAlso _statuses.Tabs(ListTab.SelectedTab.Text).TabType = TabUsageType.Related Then
+ Dim relTp As TabPage = ListTab.SelectedTab
+ Dim backToTab As TabClass = _statuses.Tabs(relTp.Text).BackToTab
+ If backToTab IsNot Nothing Then
+ Try
+ For Each tp As TabPage In ListTab.TabPages
+ If tp.Text = backToTab.TabName Then
+ ListTab.SelectTab(tp)
+ Exit For
+ End If
+ Next
+ Catch ex As Exception
+
+ End Try
+ End If
+ RemoveSpecifiedTab(relTp.Text, False)
+ SaveConfigsTabs()
+ End If
End If
End If
Private Sub DeleteTabMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DeleteTabMenuItem.Click, DeleteTbMenuItem.Click
If String.IsNullOrEmpty(_rclickTabName) OrElse sender Is Me.DeleteTbMenuItem Then _rclickTabName = ListTab.SelectedTab.Text
- RemoveSpecifiedTab(_rclickTabName)
+ RemoveSpecifiedTab(_rclickTabName, True)
SaveConfigsTabs()
End Sub
Private Sub CopyUserIdStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyUserIdStripMenuItem.Click
CopyUserId()
End Sub
+
Private Sub CopyUserId()
If _curPost Is Nothing Then Exit Sub
Dim clstr As String = _curPost.Name
End Sub
Private Sub ShowRelatedStatusesMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowRelatedStatusesMenuItem.Click, ShowRelatedStatusesMenuItem2.Click
+ Dim backToTab As TabClass = If(_curTab Is Nothing, _statuses.Tabs(ListTab.SelectedTab.Text), _statuses.Tabs(_curTab.Text))
If Me.ExistCurrentPost AndAlso Not _curPost.IsDm Then
'PublicSearchも除外した方がよい?
If _statuses.GetTabByType(TabUsageType.Related) Is Nothing Then
_statuses.AddTab(tName, TabUsageType.Related, Nothing)
End If
_statuses.GetTabByName(tName).UnreadManage = False
+ _statuses.GetTabByName(tName).Notify = False
End If
Dim tb As TabClass = _statuses.GetTabByType(TabUsageType.Related)
tb.RelationTargetPost = _curPost
+ tb.BackToTab = backToTab
Me.ClearTab(tb.TabName, False)
For i As Integer = 0 To ListTab.TabPages.Count - 1
If tb.TabName = ListTab.TabPages(i).Text Then
End Function
Public Function GetRelatedResult(ByVal read As Boolean, ByVal tab As TabClass) As String
+ Dim rslt As String = ""
Dim relPosts As New List(Of PostClass)
+ If tab.RelationTargetPost.Data.Contains("@") AndAlso tab.RelationTargetPost.InReplyToId = 0 Then
+ '検索結果対応
+ Dim p As PostClass = TabInformations.GetInstance.Item(tab.RelationTargetPost.Id)
+ If p IsNot Nothing AndAlso p.InReplyToId > 0 Then
+ tab.RelationTargetPost = p
+ Else
+ rslt = Me.GetStatusApi(read, tab.RelationTargetPost.Id, p)
+ If Not String.IsNullOrEmpty(rslt) Then Return rslt
+ tab.RelationTargetPost = p
+ End If
+ End If
relPosts.Add(tab.RelationTargetPost.Copy)
Dim tmpPost As PostClass = relPosts(0)
- Dim rslt As String = ""
Do
rslt = Me.GetRelatedResultsApi(read, tmpPost, tab, relPosts)
If Not String.IsNullOrEmpty(rslt) Then Exit Do