diff --git a/OpenTween.Tests/DetailsListViewTest.cs b/OpenTween.Tests/DetailsListViewTest.cs index d890a1499..3250c7dec 100644 --- a/OpenTween.Tests/DetailsListViewTest.cs +++ b/OpenTween.Tests/DetailsListViewTest.cs @@ -20,10 +20,7 @@ // Boston, MA 02110-1301, USA. using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using OpenTween.OpenTweenCustomControl; using Xunit; @@ -36,5 +33,110 @@ public void Initialize_Test() { using var listView = new DetailsListView(); } + + [WinFormsFact] + public void SelectionMark_Test() + { + using var listView = new DetailsListView(); + + listView.RetrieveVirtualItem += (s, e) => e.Item = new(); + listView.VirtualMode = true; + listView.VirtualListSize = 10; + listView.CreateControl(); + + listView.SelectionMark = 3; + Assert.Equal(3, listView.SelectionMark); + } + + [WinFormsFact] + public void SelectItems_EmptyTest() + { + using var listView = new DetailsListView(); + + listView.RetrieveVirtualItem += (s, e) => e.Item = new(); + listView.VirtualMode = true; + listView.VirtualListSize = 10; + listView.CreateControl(); + + listView.SelectedIndices.Add(1); + Assert.Single(listView.SelectedIndices); + + listView.SelectItems(Array.Empty()); + Assert.Empty(listView.SelectedIndices); + } + + [WinFormsFact] + public void SelectItems_SingleTest() + { + using var listView = new DetailsListView(); + + listView.RetrieveVirtualItem += (s, e) => e.Item = new(); + listView.VirtualMode = true; + listView.VirtualListSize = 10; + listView.CreateControl(); + + listView.SelectedIndices.Add(1); + Assert.Single(listView.SelectedIndices); + + listView.SelectItems(new[] { 2 }); + Assert.Equal(new[] { 2 }, listView.SelectedIndices.Cast()); + } + + [WinFormsFact] + public void SelectItems_Multiple_ClearAndSelectTest() + { + using var listView = new DetailsListView(); + + listView.RetrieveVirtualItem += (s, e) => e.Item = new(); + listView.VirtualMode = true; + listView.VirtualListSize = 10; + listView.CreateControl(); + + listView.SelectedIndices.Add(2); + listView.SelectedIndices.Add(3); + Assert.Equal(2, listView.SelectedIndices.Count); + + // Clear して選択し直した方が早いパターン + listView.SelectItems(new[] { 5, 6 }); + Assert.Equal(new[] { 5, 6 }, listView.SelectedIndices.Cast()); + } + + [WinFormsFact] + public void SelectItems_Multiple_DeselectAndSelectTest() + { + using var listView = new DetailsListView(); + + listView.RetrieveVirtualItem += (s, e) => e.Item = new(); + listView.VirtualMode = true; + listView.VirtualListSize = 10; + listView.CreateControl(); + + listView.SelectedIndices.Add(1); + listView.SelectedIndices.Add(2); + listView.SelectedIndices.Add(3); + Assert.Equal(3, listView.SelectedIndices.Count); + + // 選択範囲の差分だけ更新した方が早いパターン + listView.SelectItems(new[] { 2, 3, 4 }); + Assert.Equal(new[] { 2, 3, 4 }, listView.SelectedIndices.Cast()); + } + + [WinFormsFact] + public void SelectItems_OutOfRangeTest() + { + using var listView = new DetailsListView(); + + listView.RetrieveVirtualItem += (s, e) => e.Item = new(); + listView.VirtualMode = true; + listView.VirtualListSize = 10; + listView.CreateControl(); + + Assert.Throws( + () => listView.SelectItems(new[] { -1 }) + ); + Assert.Throws( + () => listView.SelectItems(new[] { 10 }) + ); + } } } diff --git a/OpenTween.Tests/Models/TabModelTest.cs b/OpenTween.Tests/Models/TabModelTest.cs index f256d15aa..df6cd6263 100644 --- a/OpenTween.Tests/Models/TabModelTest.cs +++ b/OpenTween.Tests/Models/TabModelTest.cs @@ -673,6 +673,88 @@ public void OnFilterModified_DetachedTest() Assert.False(tab.FilterModified); } + [Fact] + public void IndexOf_SingleFoundTest() + { + var tab = new PublicSearchTabModel("search"); + + tab.AddPostQueue(new() + { + StatusId = new TwitterStatusId("100"), + CreatedAtForSorting = new(2023, 1, 1, 0, 0, 0), + TextFromApi = "aaa", + }); + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + tab.AddSubmit(); + + Assert.Equal(0, tab.IndexOf(new TwitterStatusId("100"))); + } + + [Fact] + public void IndexOf_SingleNotFoundTest() + { + var tab = new PublicSearchTabModel("search"); + + tab.AddPostQueue(new() + { + StatusId = new TwitterStatusId("100"), + CreatedAtForSorting = new(2023, 1, 1, 0, 0, 0), + TextFromApi = "aaa", + }); + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + tab.AddSubmit(); + + Assert.Equal(-1, tab.IndexOf(new TwitterStatusId("200"))); + } + + [Fact] + public void IndexOf_MultipleFoundTest() + { + var tab = new PublicSearchTabModel("search"); + + tab.AddPostQueue(new() + { + StatusId = new TwitterStatusId("100"), + CreatedAtForSorting = new(2023, 1, 1, 0, 0, 0), + TextFromApi = "aaa", + }); + tab.AddPostQueue(new() + { + StatusId = new TwitterStatusId("200"), + CreatedAtForSorting = new(2023, 1, 1, 0, 0, 1), + TextFromApi = "bbb", + }); + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + tab.AddSubmit(); + + var actual = tab.IndexOf(new[] { new TwitterStatusId("200"), new TwitterStatusId("100") }); + Assert.Equal(new[] { 1, 0 }, actual); + } + + [Fact] + public void IndexOf_MultiplePartiallyFoundTest() + { + var tab = new PublicSearchTabModel("search"); + + tab.AddPostQueue(new() + { + StatusId = new TwitterStatusId("100"), + CreatedAtForSorting = new(2023, 1, 1, 0, 0, 0), + TextFromApi = "aaa", + }); + tab.AddPostQueue(new() + { + StatusId = new TwitterStatusId("200"), + CreatedAtForSorting = new(2023, 1, 1, 0, 0, 1), + TextFromApi = "bbb", + }); + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + tab.AddSubmit(); + + var actual = tab.IndexOf(new[] { new TwitterStatusId("100"), new TwitterStatusId("999") }); + Assert.Equal(new[] { 0, -1 }, actual); + } + [Fact] public void SearchPostsAll_Test() { diff --git a/OpenTween.Tests/Models/TwitterPostFactoryTest.cs b/OpenTween.Tests/Models/TwitterPostFactoryTest.cs index 88718fd24..6a31f012b 100644 --- a/OpenTween.Tests/Models/TwitterPostFactoryTest.cs +++ b/OpenTween.Tests/Models/TwitterPostFactoryTest.cs @@ -286,6 +286,27 @@ public void CreateFromDirectMessageEvent_SenderTest() Assert.True(post.IsMe); } + [Fact] + public void GetReceivedHashtags_Test() + { + var factory = new TwitterPostFactory(this.CreateTabinfo()); + var status = this.CreateStatus(); + status.FullText = "hoge #OpenTween"; + status.Entities.Hashtags = new[] + { + new TwitterEntityHashtag + { + Indices = new[] { 5, 15 }, + Text = "OpenTween", + }, + }; + + _ = factory.CreateFromStatus(status, selfUserId: 20000L, followerIds: EmptyIdSet); + + Assert.Equal(new[] { "#OpenTween" }, factory.GetReceivedHashtags()); + Assert.Empty(factory.GetReceivedHashtags()); + } + [Fact] public void CreateFromStatus_MediaAltTest() { diff --git a/OpenTween.Tests/TimelineListViewStateTest.cs b/OpenTween.Tests/TimelineListViewStateTest.cs index eb4d8f4cd..a49d74cbe 100644 --- a/OpenTween.Tests/TimelineListViewStateTest.cs +++ b/OpenTween.Tests/TimelineListViewStateTest.cs @@ -20,10 +20,8 @@ // Boston, MA 02110-1301, USA. using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Windows.Forms; using OpenTween.Models; using OpenTween.OpenTweenCustomControl; using Xunit; @@ -39,5 +37,363 @@ public void Initialize_Test() var tab = new PublicSearchTabModel("hoge"); var listViewState = new TimelineListViewState(listView, tab); } + + private void UsingListView(int count, Action func) + { + using var listView = new DetailsListView(); + listView.Columns.Add("col"); + listView.HeaderStyle = ColumnHeaderStyle.None; // 座標計算の邪魔になるため非表示にする + + listView.RetrieveVirtualItem += (s, e) => e.Item = new($"text {e.ItemIndex}"); + listView.VirtualMode = true; + listView.VirtualListSize = count; + + using var imageList = new ImageList { ImageSize = new(1, 19) }; + listView.SmallImageList = imageList; // Item の高さは 20px + listView.ClientSize = new(100, 100); // 高さは 5 行分 + listView.CreateControl(); + + var tab = new PublicSearchTabModel("hoge"); + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + + var firstDateTime = new DateTimeUtc(2024, 1, 1, 0, 0, 0); + foreach (var i in MyCommon.CountUp(0, count - 1)) + { + var post = new PostClass + { + StatusId = new TwitterStatusId(i.ToString()), + CreatedAtForSorting = firstDateTime + TimeSpan.FromSeconds(i), + }; + tab.AddPostQueue(post); + } + tab.AddSubmit(); + + func(listView, tab); + } + + [WinFormsFact] + public void GetScrollLockMode_IdAsc_Test() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.EnsureVisible(0); // 一番上にスクロール + + // 投稿日時の昇順に並んでいる場合、新着投稿によってスクロール位置がズレることがないため None を返す + Assert.Equal( + TimelineListViewState.ScrollLockMode.None, + listViewState.GetScrollLockMode(lockScroll: false) + ); + }); + } + + [WinFormsFact] + public void GetScrollLockMode_IdAsc_BottomTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.EnsureVisible(9); // 一番下までスクロール + + // 最終行が表示されている場合はスクロール位置を一番下に固定する(新着投稿を表示し続ける) + Assert.Equal( + TimelineListViewState.ScrollLockMode.FixedToBottom, + listViewState.GetScrollLockMode(lockScroll: false) + ); + }); + } + + [WinFormsFact] + public void GetScrollLockMode_IdAsc_BottomLockScrollTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.EnsureVisible(9); // 一番下までスクロール + + // 最終行が表示されていても lockScroll が true の場合は None を返す(新着投稿にスクロールしない) + Assert.Equal( + TimelineListViewState.ScrollLockMode.None, + listViewState.GetScrollLockMode(lockScroll: true) + ); + }); + } + + [WinFormsFact] + public void GetScrollLockMode_IdDesc_TopTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Descending); + listView.EnsureVisible(0); // 一番上にスクロール + + // 投稿日時の降順に並んでいて 1 行目が表示されている場合はスクロール位置を一番上に固定する(新着投稿を表示し続ける) + Assert.Equal( + TimelineListViewState.ScrollLockMode.FixedToTop, + listViewState.GetScrollLockMode(lockScroll: false) + ); + }); + } + + [WinFormsFact] + public void GetScrollLockMode_IdDesc_TopLockScrollTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Descending); + listView.EnsureVisible(0); // 一番上にスクロール + + // 先頭行が表示されていても lockScroll が true の場合は FixedToItem を返す(新着投稿にスクロールしない) + Assert.Equal( + TimelineListViewState.ScrollLockMode.FixedToItem, + listViewState.GetScrollLockMode(lockScroll: true) + ); + }); + } + + [WinFormsFact] + public void GetScrollLockMode_IdDesc_BottomTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Descending); + listView.EnsureVisible(9); // 一番下にスクロール + + // 先頭行が表示されていない場合は FixedToItem を返す + Assert.Equal( + TimelineListViewState.ScrollLockMode.FixedToItem, + listViewState.GetScrollLockMode(lockScroll: false) + ); + }); + } + + [WinFormsFact] + public void GetScrollLockMode_TextAsc_Test() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Data, SortOrder.Ascending); + listView.EnsureVisible(0); // 一番上にスクロール + + // ComparerMode.Id 以外の場合は常に FixedToItem を返す + Assert.Equal( + TimelineListViewState.ScrollLockMode.FixedToItem, + listViewState.GetScrollLockMode(lockScroll: false) + ); + }); + } + + [WinFormsFact] + public void GetListViewScroll_Test() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Descending); // 投稿日時の降順 + listView.TopItem = listView.Items[2]; // 3 行目が一番上になる位置にスクロールされた状態 + + var scrollState = listViewState.GetListViewScroll(lockScroll: false); + Assert.Equal( + TimelineListViewState.ScrollLockMode.FixedToItem, + scrollState.ScrollLockMode + ); + Assert.Equal(new TwitterStatusId("7"), scrollState.TopItemStatusId); // 3 行目の StatusId は "7" + }); + } + + [WinFormsFact] + public void RestoreListViewScroll_FixedToTopTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.TopItem = listView.Items[2]; // 3 行目が一番上になる位置にスクロールされた状態 + + var scrollState = new TimelineListViewState.ListViewScroll( + ScrollLockMode: TimelineListViewState.ScrollLockMode.FixedToTop, + TopItemStatusId: null + ); + listViewState.RestoreListViewScroll(scrollState, forceScroll: false); + + // 一番上にスクロールされた状態になる + Assert.Equal(0, listView.TopItem.Index); + }); + } + + [WinFormsFact] + public void RestoreListViewScroll_FixedToBottomTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.TopItem = listView.Items[2]; // 3 行目が一番上になる位置にスクロールされた状態 + + var scrollState = new TimelineListViewState.ListViewScroll( + ScrollLockMode: TimelineListViewState.ScrollLockMode.FixedToBottom, + TopItemStatusId: null + ); + listViewState.RestoreListViewScroll(scrollState, forceScroll: false); + + // 一番下にスクロールされた状態になる(一番下に余白が生じるため null になる) + Assert.Null(listView.GetItemAt(0, 82)?.Index); + }); + } + + [WinFormsFact] + public void RestoreListViewScroll_FixedToItemTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.TopItem = listView.Items[2]; // 3 行目が一番上になる位置にスクロールされた状態 + + var scrollState = new TimelineListViewState.ListViewScroll( + ScrollLockMode: TimelineListViewState.ScrollLockMode.FixedToItem, + TopItemStatusId: new TwitterStatusId("5") + ); + listViewState.RestoreListViewScroll(scrollState, forceScroll: false); + + // 6 行目が一番上になる位置にスクロールされた状態になる + Assert.Equal(5, listView.TopItem.Index); + }); + } + + [WinFormsFact] + public void RestoreListViewScroll_NoneTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.TopItem = listView.Items[2]; // 3 行目が一番上になる位置にスクロールされた状態 + + var scrollState = new TimelineListViewState.ListViewScroll( + ScrollLockMode: TimelineListViewState.ScrollLockMode.None, + TopItemStatusId: new TwitterStatusId("5") + ); + listViewState.RestoreListViewScroll(scrollState, forceScroll: false); + + // ScrollLockMode.None の場合は何もしない + Assert.Equal(2, listView.TopItem.Index); + }); + } + + [WinFormsFact] + public void RestoreListViewScroll_ForceScrollTest() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + tab.SetSortMode(ComparerMode.Id, SortOrder.Ascending); + listView.TopItem = listView.Items[2]; // 3 行目が一番上になる位置にスクロールされた状態 + + var scrollState = new TimelineListViewState.ListViewScroll( + ScrollLockMode: TimelineListViewState.ScrollLockMode.None, + TopItemStatusId: new TwitterStatusId("5") + ); + listViewState.RestoreListViewScroll(scrollState, forceScroll: true); + + // ScrollLockMode.None でも forceScroll が true の場合は FixedToItem 相当の動作になる + Assert.Equal(5, listView.TopItem.Index); + }); + } + + [WinFormsFact] + public void GetListViewSelection_EmptyTest() + { + this.UsingListView(count: 0, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + var selectionState = listViewState.GetListViewSelection(); + Assert.Empty(selectionState.SelectedStatusIds); + Assert.Null(selectionState.SelectionMarkStatusId); + Assert.Null(selectionState.FocusedStatusId); + }); + } + + [WinFormsFact] + public void GetListViewSelection_Test() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + listView.SelectedIndices.Add(0); + listView.SelectedIndices.Add(2); + listView.SelectedIndices.Add(3); + tab.SelectPosts(new[] { 0, 2, 3 }); + listView.SelectionMark = 1; + listView.FocusedItem = listView.Items[3]; + + var selectionState = listViewState.GetListViewSelection(); + Assert.Equal(new TwitterStatusId[] { new("0"), new("2"), new("3") }, selectionState.SelectedStatusIds); + Assert.Equal(new TwitterStatusId("1"), selectionState.SelectionMarkStatusId); + Assert.Equal(new TwitterStatusId("3"), selectionState.FocusedStatusId); + }); + } + + [WinFormsFact] + public void RestoreListViewSelection_Test() + { + this.UsingListView(count: 10, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + var selectionState = new TimelineListViewState.ListViewSelection( + SelectedStatusIds: new TwitterStatusId[] { new("1"), new("2"), new("3") }, + SelectionMarkStatusId: new TwitterStatusId("1"), + FocusedStatusId: new TwitterStatusId("3") + ); + listViewState.RestoreListViewSelection(selectionState); + + Assert.Equal(new[] { 1, 2, 3 }, listView.SelectedIndices.Cast()); + Assert.Equal(1, listView.SelectionMark); + Assert.Equal(3, listView.FocusedItem?.Index); + }); + } + + [WinFormsFact] + public void RestoreListViewSelection_EmptyTest() + { + this.UsingListView(count: 0, (listView, tab) => + { + var listViewState = new TimelineListViewState(listView, tab); + + var selectionState = new TimelineListViewState.ListViewSelection( + SelectedStatusIds: Array.Empty(), + SelectionMarkStatusId: null, + FocusedStatusId: null + ); + listViewState.RestoreListViewSelection(selectionState); + + Assert.Empty(listView.SelectedIndices); + Assert.Equal(-1, listView.SelectionMark); + Assert.Null(listView.FocusedItem?.Index); + }); + } } } diff --git a/OpenTween.Tests/TweenMainTest.cs b/OpenTween.Tests/TweenMainTest.cs index 2b6da7991..178237d62 100644 --- a/OpenTween.Tests/TweenMainTest.cs +++ b/OpenTween.Tests/TweenMainTest.cs @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; @@ -55,6 +56,11 @@ private void UsingTweenMain(Action func) using var iconAssets = new IconAssetsManager(); var thumbnailGenerator = new ThumbnailGenerator(new(autoupdate: false)); + // TabInformation.GetInstance() で取得できるようにする + var field = typeof(TabInformations).GetField("Instance", + BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.SetField); + field.SetValue(null, tabinfo); + using var tweenMain = new TweenMain(settings, tabinfo, twitter, imageCache, iconAssets, thumbnailGenerator); var context = new TestContext(settings, tabinfo); @@ -174,6 +180,36 @@ public void AddNewTab_PublicSearchTabTest() }); } + [WinFormsFact] + public void RefreshTimeline_Test() + { + this.UsingTweenMain((tweenMain, context) => + { + var tabPage = tweenMain.ListTab.TabPages[0]; + Assert.Equal("Recent", tabPage.Text); + + var listView = (DetailsListView)tabPage.Controls[0]; + Assert.Equal(0, listView.VirtualListSize); + + var post = new PostClass + { + StatusId = new TwitterStatusId("100"), + Text = "hoge", + UserId = 111L, + ScreenName = "opentween", + CreatedAt = new(2024, 1, 1, 0, 0, 0), + }; + context.TabInfo.AddPost(post); + context.TabInfo.DistributePosts(); + tweenMain.RefreshTimeline(); + + Assert.Equal(1, listView.VirtualListSize); + + var listItem = listView.Items[0]; + Assert.Equal("opentween", listItem.SubItems[4].Text); + }); + } + [WinFormsFact] public void FormatStatusText_NewLineTest() { diff --git a/OpenTween/TimelineListViewState.cs b/OpenTween/TimelineListViewState.cs index 9878d5b66..5625414f8 100644 --- a/OpenTween/TimelineListViewState.cs +++ b/OpenTween/TimelineListViewState.cs @@ -78,8 +78,8 @@ public TimelineListViewState(DetailsListView listView, TabModel tab) public void Save(bool lockScroll) { - this.savedScrollState = this.SaveListViewScroll(lockScroll); - this.savedSelectionState = this.SaveListViewSelection(); + this.savedScrollState = this.GetListViewScroll(lockScroll); + this.savedSelectionState = this.GetListViewSelection(); } public void Restore(bool forceScroll = false) @@ -97,7 +97,7 @@ public void RestoreSelection() /// /// のスクロール位置に関する情報を として返します /// - private ListViewScroll SaveListViewScroll(bool lockScroll) + internal ListViewScroll GetListViewScroll(bool lockScroll) { var lockMode = this.GetScrollLockMode(lockScroll); PostId? topItemStatusId = null; @@ -117,7 +117,7 @@ private ListViewScroll SaveListViewScroll(bool lockScroll) }; } - private ScrollLockMode GetScrollLockMode(bool lockScroll) + internal ScrollLockMode GetScrollLockMode(bool lockScroll) { if (this.tab.SortMode == ComparerMode.Id) { @@ -159,7 +159,7 @@ private ScrollLockMode GetScrollLockMode(bool lockScroll) /// /// の選択状態を として返します /// - private ListViewSelection SaveListViewSelection() + internal ListViewSelection GetListViewSelection() { if (this.listView.VirtualListSize == 0) { @@ -194,9 +194,9 @@ private ListViewSelection SaveListViewSelection() } /// - /// によって保存されたスクロール位置を復元します + /// によって保存されたスクロール位置を復元します /// - private void RestoreListViewScroll(ListViewScroll listScroll, bool forceScroll) + internal void RestoreListViewScroll(ListViewScroll listScroll, bool forceScroll) { if (this.listView.VirtualListSize == 0) return; @@ -236,9 +236,9 @@ private void RestoreListViewScroll(ListViewScroll listScroll, bool forceScroll) } /// - /// によって保存された選択状態を復元します + /// によって保存された選択状態を復元します /// - private void RestoreListViewSelection(ListViewSelection listSelection) + internal void RestoreListViewSelection(ListViewSelection listSelection) { var invalidateBounds = (Rectangle?)null; diff --git a/OpenTween/Tween.cs b/OpenTween/Tween.cs index f2d9080c7..90832f7cc 100644 --- a/OpenTween/Tween.cs +++ b/OpenTween/Tween.cs @@ -811,7 +811,7 @@ internal void MarkSettingAtIdModified() _ = this.saveConfigDebouncer.Call(); } - private void RefreshTimeline() + internal void RefreshTimeline() { var curListView = this.CurrentListView;