ファイル整理用ツールのWinFormサンプル実装
リビジョン | 32c1780aade0cbf48e899f027f76c3d2782904c2 (tree) |
---|---|
日時 | 2018-12-27 10:30:42 |
作者 | yoshy <yoshy@user...> |
コミッター | yoshy |
リファクタ - 不要ソース削除、折り返し調整等
@@ -66,6 +66,8 @@ namespace FolderCategorizer.Presentation.View | ||
66 | 66 | |
67 | 67 | private DPIHelper dpiHelper; |
68 | 68 | |
69 | + private ShellUtils.DropTarget dropHelper; | |
70 | + | |
69 | 71 | #endregion |
70 | 72 | |
71 | 73 | #region UI Enabler Properties |
@@ -95,8 +97,6 @@ namespace FolderCategorizer.Presentation.View | ||
95 | 97 | |
96 | 98 | public string[] SrcFolderPaths { get; set; } = null; |
97 | 99 | |
98 | - //public ImageList DraggedImageList { get; set; } = null; | |
99 | - | |
100 | 100 | public DraggedFileListEntriesHolder() |
101 | 101 | { |
102 | 102 | DroppedEntries = new FileListEntry[0]; |
@@ -105,25 +105,29 @@ namespace FolderCategorizer.Presentation.View | ||
105 | 105 | SrcFolderPaths = new string[0]; |
106 | 106 | } |
107 | 107 | |
108 | - public DraggedFileListEntriesHolder(FileListEntry[] selectedListEntries, TreeNodeStatus[] selectedNodeStatuses, string[] prohibitedFolders, string srcRefreshPath) | |
108 | + public DraggedFileListEntriesHolder( | |
109 | + FileListEntry[] selectedListEntries, TreeNodeStatus[] selectedNodeStatuses, | |
110 | + string[] srcFolderPaths, string srcRefreshPath) | |
109 | 111 | { |
110 | 112 | SelectedListEntries = selectedListEntries; |
111 | 113 | SelectedNodeStatuses = selectedNodeStatuses; |
112 | - SrcFolderPaths = prohibitedFolders; | |
114 | + SrcFolderPaths = srcFolderPaths; | |
113 | 115 | SrcRefreshPath = srcRefreshPath; |
114 | 116 | |
115 | 117 | DroppedEntries = SelectedListEntries; |
116 | 118 | } |
117 | 119 | |
118 | - public DraggedFileListEntriesHolder(FileListEntry[] selectedItems, TreeNodeStatus[] selectedNodes, TreeNode draggedNode) | |
120 | + public DraggedFileListEntriesHolder( | |
121 | + FileListEntry[] selectedListEntries, TreeNodeStatus[] selectedNodeStatuses, TreeNode draggedNode) | |
119 | 122 | { |
120 | - SelectedListEntries = selectedItems; | |
121 | - SelectedNodeStatuses = selectedNodes; | |
123 | + SelectedListEntries = selectedListEntries; | |
124 | + SelectedNodeStatuses = selectedNodeStatuses; | |
122 | 125 | |
123 | 126 | SrcRefreshPath = Path.GetDirectoryName(TreeNodeStatus.FromTagOf(draggedNode).RelativePath); |
124 | 127 | |
125 | 128 | FileListEntry droppedEntry = new FileListEntry( |
126 | - draggedNode.Name, Path.GetDirectoryName(TreeNodeStatus.FromTagOf(draggedNode).RelativePath), FileListEntry.EntryType.FOLDER); | |
129 | + draggedNode.Name, Path.GetDirectoryName( | |
130 | + TreeNodeStatus.FromTagOf(draggedNode).RelativePath), FileListEntry.EntryType.FOLDER); | |
127 | 131 | |
128 | 132 | DroppedEntries = new FileListEntry[] { droppedEntry }; |
129 | 133 | SrcFolderPaths = new string[] { droppedEntry.RelativePath }; |
@@ -132,8 +136,6 @@ namespace FolderCategorizer.Presentation.View | ||
132 | 136 | |
133 | 137 | private DraggedFileListEntriesHolder DraggedFileListEntries { get; set; } = null; |
134 | 138 | |
135 | - private ShellUtils.DropTarget dropHelper = null; | |
136 | - | |
137 | 139 | #endregion |
138 | 140 | |
139 | 141 | #region Tree Node Status Structures |
@@ -170,7 +172,8 @@ namespace FolderCategorizer.Presentation.View | ||
170 | 172 | { |
171 | 173 | Node = node; |
172 | 174 | FullPath = fullPath; |
173 | - Level = Enum.IsDefined(typeof(RecursiveSearchLevel), level) ? (RecursiveSearchLevel)level : RecursiveSearchLevel.INVALID; | |
175 | + Level = Enum.IsDefined(typeof(RecursiveSearchLevel), level) | |
176 | + ? (RecursiveSearchLevel)level : RecursiveSearchLevel.INVALID; | |
174 | 177 | } |
175 | 178 | |
176 | 179 | public void CreateRelativePath(TreeNode parent, TreeNode current) |
@@ -360,7 +363,11 @@ namespace FolderCategorizer.Presentation.View | ||
360 | 363 | |
361 | 364 | public static ListViewItem CreateListViewItem(DirectoryInfo di) |
362 | 365 | { |
363 | - string[] texts = new string[] { di.Name, FormatFileListDateTime(di.CreationTime), FormatFileListDateTime(di.LastWriteTime), LABEL_NA, LABEL_NA }; | |
366 | + string[] texts = new string[] | |
367 | + { | |
368 | + di.Name, FormatFileListDateTime(di.CreationTime), FormatFileListDateTime(di.LastWriteTime), | |
369 | + LABEL_NA, LABEL_NA | |
370 | + }; | |
364 | 371 | |
365 | 372 | ListViewItem item = new ListViewItem(texts, (int)IconNo.FOLDER) |
366 | 373 | { |
@@ -464,10 +471,10 @@ namespace FolderCategorizer.Presentation.View | ||
464 | 471 | public static bool TryParseFolderCreateionDateTime(out DateTime dateTime, string str) |
465 | 472 | { |
466 | 473 | return DateTime.TryParseExact( |
467 | - str, FOLDER_CREATION_DATETIME_FORMAT, | |
468 | - System.Globalization.DateTimeFormatInfo.InvariantInfo, | |
469 | - System.Globalization.DateTimeStyles.NoCurrentDateDefault, | |
470 | - out dateTime); | |
474 | + str, FOLDER_CREATION_DATETIME_FORMAT, | |
475 | + DateTimeFormatInfo.InvariantInfo, | |
476 | + DateTimeStyles.NoCurrentDateDefault, | |
477 | + out dateTime); | |
471 | 478 | } |
472 | 479 | |
473 | 480 | public string GetTypeName() |
@@ -480,20 +487,6 @@ namespace FolderCategorizer.Presentation.View | ||
480 | 487 | return Path.GetFileName(RelativePath); |
481 | 488 | } |
482 | 489 | |
483 | - public EntryType Type { get; set; } | |
484 | - | |
485 | - public ListViewItem Item { get; set; } | |
486 | - | |
487 | - public string RelativePath { get; set; } | |
488 | - | |
489 | - public string Extension { get; set; } | |
490 | - | |
491 | - public long Length { get; set; } | |
492 | - | |
493 | - public DateTime CreationTime { get; set; } | |
494 | - | |
495 | - public DateTime LastWriteTime { get; set; } | |
496 | - | |
497 | 490 | public bool IsFolder() |
498 | 491 | { |
499 | 492 | return Type == EntryType.FOLDER; |
@@ -508,6 +501,20 @@ namespace FolderCategorizer.Presentation.View | ||
508 | 501 | { |
509 | 502 | return Type == EntryType.UPWARDS; |
510 | 503 | } |
504 | + | |
505 | + public EntryType Type { get; set; } | |
506 | + | |
507 | + public ListViewItem Item { get; set; } | |
508 | + | |
509 | + public string RelativePath { get; set; } | |
510 | + | |
511 | + public string Extension { get; set; } | |
512 | + | |
513 | + public long Length { get; set; } | |
514 | + | |
515 | + public DateTime CreationTime { get; set; } | |
516 | + | |
517 | + public DateTime LastWriteTime { get; set; } | |
511 | 518 | } |
512 | 519 | |
513 | 520 | private class FileListEntrySorter : IComparer |
@@ -640,13 +647,15 @@ namespace FolderCategorizer.Presentation.View | ||
640 | 647 | new Component[] |
641 | 648 | { |
642 | 649 | txtDebug, txtSrcFolder1, txtSrcFolder2, |
643 | - cbNewFolderDate, cbNewFolderClass, cbNewFolderName, cbNewFolderCreationAt, cbNewFolderLastWriteAt, | |
650 | + cbNewFolderDate, cbNewFolderClass, cbNewFolderName, | |
651 | + cbNewFolderCreationAt, cbNewFolderLastWriteAt, | |
644 | 652 | tvSrcFolder1, tvSrcFolder2, lvFileList, |
645 | 653 | statusStrip1, |
646 | 654 | contextMenuStrip1, |
647 | 655 | }, new Control[] { |
648 | 656 | tvSrcFolder1, tvSrcFolder2, lvFileList |
649 | - }, hiresImageList, normalImageList | |
657 | + }, | |
658 | + hiresImageList, normalImageList | |
650 | 659 | ); |
651 | 660 | |
652 | 661 | dropHelper = new ShellUtils.DropTarget(lvFileList.Handle); |
@@ -666,12 +675,14 @@ namespace FolderCategorizer.Presentation.View | ||
666 | 675 | |
667 | 676 | #region Dialog Functions |
668 | 677 | |
669 | - private static DialogResult ShowOperationSkipSelector(string msg, string label, string path, FileSystemOperationUIInfo uiInfo) | |
678 | + private static DialogResult ShowOperationSkipSelector( | |
679 | + string msg, string label, string path, FileSystemOperationUIInfo uiInfo) | |
670 | 680 | { |
671 | 681 | return ShowOperationSkipSelector(msg, label, uiInfo.TargetType, path, uiInfo); |
672 | 682 | } |
673 | 683 | |
674 | - private static DialogResult ShowOperationSkipSelector(string msg, string label, string typeName, string path, FileSystemOperationUIInfo uiInfo) | |
684 | + private static DialogResult ShowOperationSkipSelector( | |
685 | + string msg, string label, string typeName, string path, FileSystemOperationUIInfo uiInfo) | |
675 | 686 | { |
676 | 687 | return ShowYesNoCancelDlg( |
677 | 688 | $"{msg + NEW_LINE}以下の{label}の{typeName}の{uiInfo.Operation}をスキップしますか?{DOUBLE_NEW_LINE}" |
@@ -870,17 +881,20 @@ namespace FolderCategorizer.Presentation.View | ||
870 | 881 | |
871 | 882 | if (targetPathsForMsg1.Count > 0) |
872 | 883 | { |
873 | - joinedMsg1 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}対象1】{NEW_LINE}" + string.Join(NEW_LINE, targetPathsForMsg1); | |
884 | + joinedMsg1 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}対象1】{NEW_LINE}" + | |
885 | + string.Join(NEW_LINE, targetPathsForMsg1); | |
874 | 886 | } |
875 | 887 | |
876 | 888 | string joinedMsg2 = string.Empty; |
877 | 889 | |
878 | 890 | if (targetPathsForMsg2.Count > 0) |
879 | 891 | { |
880 | - joinedMsg2 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}対象2】{NEW_LINE}" + string.Join(NEW_LINE, targetPathsForMsg2); | |
892 | + joinedMsg2 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}対象2】{NEW_LINE}" + | |
893 | + string.Join(NEW_LINE, targetPathsForMsg2); | |
881 | 894 | } |
882 | 895 | |
883 | - string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?{joinedMsg1}{joinedMsg2}"; | |
896 | + string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?" + | |
897 | + $"{joinedMsg1}{joinedMsg2}"; | |
884 | 898 | |
885 | 899 | return ShowYesNoDlg(msg, uiInfo); |
886 | 900 | } |
@@ -895,7 +909,8 @@ namespace FolderCategorizer.Presentation.View | ||
895 | 909 | { |
896 | 910 | srcPathsForMsg1.Add("↓"); |
897 | 911 | srcPathsForMsg1.Add($"【{uiInfo.Operation}先1】{dstPath1}"); |
898 | - srcPathsJoinedMsg1 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}元1】{NEW_LINE}" + string.Join(NEW_LINE, srcPathsForMsg1); | |
912 | + srcPathsJoinedMsg1 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}元1】{NEW_LINE}" + | |
913 | + string.Join(NEW_LINE, srcPathsForMsg1); | |
899 | 914 | } |
900 | 915 | |
901 | 916 | string srcPathsJoinedMsg2 = string.Empty; |
@@ -904,10 +919,12 @@ namespace FolderCategorizer.Presentation.View | ||
904 | 919 | { |
905 | 920 | srcPathsForMsg2.Add("↓"); |
906 | 921 | srcPathsForMsg2.Add($"【{uiInfo.Operation}先2】{dstPath2}"); |
907 | - srcPathsJoinedMsg2 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}元2】{NEW_LINE}" + string.Join(NEW_LINE, srcPathsForMsg2); | |
922 | + srcPathsJoinedMsg2 = DOUBLE_NEW_LINE + $"【{uiInfo.Operation}元2】{NEW_LINE}" + | |
923 | + string.Join(NEW_LINE, srcPathsForMsg2); | |
908 | 924 | } |
909 | 925 | |
910 | - string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?{srcPathsJoinedMsg1}{srcPathsJoinedMsg2}"; | |
926 | + string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?" + | |
927 | + $"{srcPathsJoinedMsg1}{srcPathsJoinedMsg2}"; | |
911 | 928 | |
912 | 929 | return ShowYesNoDlg(msg, uiInfo); |
913 | 930 | } |
@@ -1160,7 +1177,9 @@ namespace FolderCategorizer.Presentation.View | ||
1160 | 1177 | |
1161 | 1178 | private static IconNo SelectFolderIconNo(DirectoryInfo dir) |
1162 | 1179 | { |
1163 | - return PathHelper.IsDrive(dir) ? IconNo.DRIVE : (PathHelper.IsReparsePoint(dir) ? IconNo.REPARSE_POINT : IconNo.FOLDER); | |
1180 | + return PathHelper.IsDrive(dir) | |
1181 | + ? IconNo.DRIVE | |
1182 | + : (PathHelper.IsReparsePoint(dir) ? IconNo.REPARSE_POINT : IconNo.FOLDER); | |
1164 | 1183 | } |
1165 | 1184 | |
1166 | 1185 | private void ForceRefreshTreeViewNode(TreeNode node) |
@@ -1247,7 +1266,9 @@ namespace FolderCategorizer.Presentation.View | ||
1247 | 1266 | |
1248 | 1267 | if (childStatus.Level != TreeNodeStatus.RecursiveSearchLevel.ALL_CHILDREN_ADDED) |
1249 | 1268 | { |
1250 | - TreeNode refreshedChild = AddFolderRecursive(new DirectoryInfo(childStatus.FullPath), RECURSIVE_SEARCH_LIMIT - 1); | |
1269 | + TreeNode refreshedChild = AddFolderRecursive( | |
1270 | + new DirectoryInfo(childStatus.FullPath), RECURSIVE_SEARCH_LIMIT - 1); | |
1271 | + | |
1251 | 1272 | node.Nodes.Insert(i + 1, refreshedChild); |
1252 | 1273 | node.Nodes.RemoveAt(i); |
1253 | 1274 | } |
@@ -1549,11 +1570,13 @@ namespace FolderCategorizer.Presentation.View | ||
1549 | 1570 | { |
1550 | 1571 | CreateCategorizeNameParts( |
1551 | 1572 | out SortedSet<string> newFolderNameDateSet, out SortedSet<string> newFolderNameClassSet, |
1552 | - out SortedSet<string> newFolderNameBodySet, out SortedSet<string> newFolderFileDateTimeAttrSet, entries); | |
1573 | + out SortedSet<string> newFolderNameBodySet, out SortedSet<string> newFolderFileDateTimeAttrSet, | |
1574 | + entries); | |
1553 | 1575 | |
1554 | 1576 | |
1555 | 1577 | ShrinkCategorizeTimeParts( |
1556 | - out List<string> newFolderNameDates, out List<string> newFolderCreationDateTimes, out List<string> newFolderLastWriteDateTimes, | |
1578 | + out List<string> newFolderNameDates, out List<string> newFolderCreationDateTimes, | |
1579 | + out List<string> newFolderLastWriteDateTimes, | |
1557 | 1580 | newFolderNameDateSet, newFolderFileDateTimeAttrSet); |
1558 | 1581 | |
1559 | 1582 | CreateFileCategorizeNameComboBoxes( |
@@ -1563,7 +1586,8 @@ namespace FolderCategorizer.Presentation.View | ||
1563 | 1586 | |
1564 | 1587 | private static void CreateCategorizeNameParts( |
1565 | 1588 | out SortedSet<string> newFolderNameDateSet, out SortedSet<string> newFolderNameClassSet, |
1566 | - out SortedSet<string> newFolderNameBodySet, out SortedSet<string> newFolderFileDateTimeAttrSet, List<FileListEntry> entries) | |
1589 | + out SortedSet<string> newFolderNameBodySet, out SortedSet<string> newFolderFileDateTimeAttrSet, | |
1590 | + List<FileListEntry> entries) | |
1567 | 1591 | { |
1568 | 1592 | newFolderNameDateSet = new SortedSet<string>(); |
1569 | 1593 | newFolderNameClassSet = new SortedSet<string>(); |
@@ -1590,8 +1614,10 @@ namespace FolderCategorizer.Presentation.View | ||
1590 | 1614 | |
1591 | 1615 | newFolderNameBodySet.Add(Path.GetFileNameWithoutExtension(entry.Item.Name)); |
1592 | 1616 | |
1593 | - newFolderFileDateTimeAttrSet.Add(FileListEntry.FormatFolderCreationDateTime(entry.CreationTime)); | |
1594 | - newFolderFileDateTimeAttrSet.Add(FileListEntry.FormatFolderCreationDateTime(entry.LastWriteTime)); | |
1617 | + newFolderFileDateTimeAttrSet.Add( | |
1618 | + FileListEntry.FormatFolderCreationDateTime(entry.CreationTime)); | |
1619 | + newFolderFileDateTimeAttrSet.Add( | |
1620 | + FileListEntry.FormatFolderCreationDateTime(entry.LastWriteTime)); | |
1595 | 1621 | } |
1596 | 1622 | break; |
1597 | 1623 |
@@ -1603,29 +1629,34 @@ namespace FolderCategorizer.Presentation.View | ||
1603 | 1629 | |
1604 | 1630 | private static void ShrinkCategorizeTimeParts( |
1605 | 1631 | out List<string> newFolderNameDates, out List<string> newFolderCreationDateTimes, |
1606 | - out List<string> newFolderLastWriteDateTimes, SortedSet<string> newFolderNameDateSet, SortedSet<string> newFolderFileDateTimeAttrSet) | |
1632 | + out List<string> newFolderLastWriteDateTimes, | |
1633 | + SortedSet<string> newFolderNameDateSet, SortedSet<string> newFolderFileDateTimeAttrSet) | |
1607 | 1634 | { |
1608 | 1635 | newFolderNameDates = new List<string>(newFolderNameDateSet); |
1609 | 1636 | if (newFolderNameDates.Count > NEW_FOLDER_DATE_LIST_MAX * 2) |
1610 | 1637 | { |
1611 | - newFolderNameDates.RemoveRange(NEW_FOLDER_DATE_LIST_MAX, newFolderNameDates.Count - NEW_FOLDER_DATE_LIST_MAX * 2); | |
1638 | + newFolderNameDates = newFolderNameDates.Take(NEW_FOLDER_DATE_LIST_MAX).Concat( | |
1639 | + newFolderNameDates.Skip( | |
1640 | + newFolderNameDates.Count - NEW_FOLDER_DATE_LIST_MAX).Take(NEW_FOLDER_DATE_LIST_MAX) | |
1641 | + ).ToList(); | |
1612 | 1642 | } |
1613 | 1643 | |
1614 | 1644 | newFolderCreationDateTimes = new List<string>(newFolderFileDateTimeAttrSet); |
1615 | 1645 | if (newFolderCreationDateTimes.Count > NEW_FOLDER_DATE_LIST_MAX) |
1616 | 1646 | { |
1617 | - newFolderCreationDateTimes.RemoveRange(NEW_FOLDER_DATE_LIST_MAX, newFolderCreationDateTimes.Count - NEW_FOLDER_DATE_LIST_MAX); | |
1647 | + newFolderCreationDateTimes = newFolderCreationDateTimes.Take(NEW_FOLDER_DATE_LIST_MAX).ToList(); | |
1618 | 1648 | } |
1619 | 1649 | |
1620 | 1650 | newFolderLastWriteDateTimes = new List<string>(newFolderFileDateTimeAttrSet.Reverse()); |
1621 | 1651 | if (newFolderLastWriteDateTimes.Count > NEW_FOLDER_DATE_LIST_MAX) |
1622 | 1652 | { |
1623 | - newFolderLastWriteDateTimes.RemoveRange(NEW_FOLDER_DATE_LIST_MAX, newFolderLastWriteDateTimes.Count - NEW_FOLDER_DATE_LIST_MAX); | |
1653 | + newFolderLastWriteDateTimes = newFolderLastWriteDateTimes.Take(NEW_FOLDER_DATE_LIST_MAX).ToList(); | |
1624 | 1654 | } |
1625 | 1655 | } |
1626 | 1656 | |
1627 | 1657 | private void CreateFileCategorizeNameComboBoxes( |
1628 | - List<string> newFolderNameDates, SortedSet<string> newFolderNameClassSet, SortedSet<string> newFolderNameBodySet, | |
1658 | + List<string> newFolderNameDates, SortedSet<string> newFolderNameClassSet, | |
1659 | + SortedSet<string> newFolderNameBodySet, | |
1629 | 1660 | List<string> newFolderCreationDateTimes, List<string> newFolderLastWriteDateTimes) |
1630 | 1661 | { |
1631 | 1662 | cbNewFolderDate.Text = string.Empty; |
@@ -1763,7 +1794,8 @@ namespace FolderCategorizer.Presentation.View | ||
1763 | 1794 | |
1764 | 1795 | string targetType = |
1765 | 1796 | (isFolder && isFile) |
1766 | - ? $"{FileListEntry.ToTypeName(FileListEntry.EntryType.FOLDER)}/{FileListEntry.ToTypeName(FileListEntry.EntryType.FOLDER)}" | |
1797 | + ? $"{FileListEntry.ToTypeName(FileListEntry.EntryType.FOLDER)}/" + | |
1798 | + $"{FileListEntry.ToTypeName(FileListEntry.EntryType.FOLDER)}" | |
1767 | 1799 | : (isFolder || isFile) |
1768 | 1800 | ? entries[0].GetTypeName() |
1769 | 1801 | : "無効なエントリ"; |
@@ -1808,7 +1840,8 @@ namespace FolderCategorizer.Presentation.View | ||
1808 | 1840 | |
1809 | 1841 | public FileSystemOperationResult AbortByTargetEmpty() |
1810 | 1842 | { |
1811 | - return Abort($"{Request.UIInfo.Operation}可能な{Request.UIInfo.TargetType}がないため、処理を中止します"); | |
1843 | + return Abort($"{Request.UIInfo.Operation}可能な" + | |
1844 | + $"{Request.UIInfo.TargetType}がないため、処理を中止します"); | |
1812 | 1845 | } |
1813 | 1846 | |
1814 | 1847 | public FileSystemOperationResult AbortWithSomeErrors() |
@@ -1845,7 +1878,8 @@ namespace FolderCategorizer.Presentation.View | ||
1845 | 1878 | public List<string> TargetPathsForMsg1 { get; private set; } = new List<string>(); |
1846 | 1879 | public List<string> TargetPathsForMsg2 { get; private set; } = new List<string>(); |
1847 | 1880 | |
1848 | - public FileSystemCreateNewTargetListOperationResult(AbstractFileSystemOperationRequest request) : base(request) | |
1881 | + public FileSystemCreateNewTargetListOperationResult( | |
1882 | + AbstractFileSystemOperationRequest request) : base(request) | |
1849 | 1883 | { |
1850 | 1884 | } |
1851 | 1885 | } |
@@ -1883,12 +1917,14 @@ namespace FolderCategorizer.Presentation.View | ||
1883 | 1917 | return new FileSystemOperationUIInfo(entries, operation); |
1884 | 1918 | } |
1885 | 1919 | |
1886 | - protected static FileSystemOperationUIInfo NewUIInfo(FileListEntry entry, string subTypeName, string operation) | |
1920 | + protected static FileSystemOperationUIInfo NewUIInfo( | |
1921 | + FileListEntry entry, string subTypeName, string operation) | |
1887 | 1922 | { |
1888 | 1923 | return new FileSystemOperationUIInfo(entry, subTypeName, operation); |
1889 | 1924 | } |
1890 | 1925 | |
1891 | - protected static FileSystemOperationUIInfo NewUIInfo(List<FileListEntry> entries, string subTypeName, string operation) | |
1926 | + protected static FileSystemOperationUIInfo NewUIInfo( | |
1927 | + List<FileListEntry> entries, string subTypeName, string operation) | |
1892 | 1928 | { |
1893 | 1929 | return new FileSystemOperationUIInfo(entries, subTypeName, operation); |
1894 | 1930 | } |
@@ -1903,7 +1939,8 @@ namespace FolderCategorizer.Presentation.View | ||
1903 | 1939 | public string RefreshPath { get; private set; } |
1904 | 1940 | |
1905 | 1941 | public AbstractFileSystemTargetOperationRequest( |
1906 | - MainForm form, FileSystemOperationUIInfo uiInfo, string targetTopPath1, string targetTopPath2, string refreshPath) | |
1942 | + MainForm form, FileSystemOperationUIInfo uiInfo, | |
1943 | + string targetTopPath1, string targetTopPath2, string refreshPath) | |
1907 | 1944 | : base(form, uiInfo) |
1908 | 1945 | { |
1909 | 1946 | TargetTopPath1 = targetTopPath1; |
@@ -1965,7 +2002,8 @@ namespace FolderCategorizer.Presentation.View | ||
1965 | 2002 | } |
1966 | 2003 | } |
1967 | 2004 | |
1968 | - public abstract class AbstractFileSystemSingleTargetOperationRequest : AbstractFileSystemTargetOperationRequest | |
2005 | + public abstract class AbstractFileSystemSingleTargetOperationRequest | |
2006 | + : AbstractFileSystemTargetOperationRequest | |
1969 | 2007 | { |
1970 | 2008 | public FileListEntry TargetEntry { get; private set; } |
1971 | 2009 |
@@ -1978,7 +2016,8 @@ namespace FolderCategorizer.Presentation.View | ||
1978 | 2016 | } |
1979 | 2017 | } |
1980 | 2018 | |
1981 | - public abstract class AbstractFileSystemMultiTargetOperationRequest : AbstractFileSystemTargetOperationRequest | |
2019 | + public abstract class AbstractFileSystemMultiTargetOperationRequest | |
2020 | + : AbstractFileSystemTargetOperationRequest | |
1982 | 2021 | { |
1983 | 2022 | public List<FileListEntry> TargetEntries { get; private set; } |
1984 | 2023 |
@@ -1991,15 +2030,17 @@ namespace FolderCategorizer.Presentation.View | ||
1991 | 2030 | } |
1992 | 2031 | } |
1993 | 2032 | |
1994 | - public abstract class AbstractFileSystemMultiSrcDstOperationRequest : AbstractFileSystemSrcDstOperationRequest | |
2033 | + public abstract class AbstractFileSystemMultiSrcDstOperationRequest | |
2034 | + : AbstractFileSystemSrcDstOperationRequest | |
1995 | 2035 | { |
1996 | 2036 | public List<FileListEntry> SrcEntries { get; private set; } |
1997 | 2037 | |
1998 | 2038 | public AbstractFileSystemMultiSrcDstOperationRequest( |
1999 | 2039 | MainForm form, FileSystemOperationUIInfo uiInfo, |
2000 | - string dstFullPath1, string dstFullPath2, string srcTopPath1, string srcTopPath2, List<FileListEntry> srcEntries, | |
2001 | - string dstRefreshPath, string srcRefreshPath) | |
2002 | - : base(form, uiInfo, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, dstRefreshPath, srcRefreshPath) | |
2040 | + string dstFullPath1, string dstFullPath2, string srcTopPath1, string srcTopPath2, | |
2041 | + List<FileListEntry> srcEntries, string dstRefreshPath, string srcRefreshPath) | |
2042 | + : base(form, uiInfo, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
2043 | + dstRefreshPath, srcRefreshPath) | |
2003 | 2044 | { |
2004 | 2045 | SrcEntries = srcEntries; |
2005 | 2046 | } |
@@ -2010,8 +2051,10 @@ namespace FolderCategorizer.Presentation.View | ||
2010 | 2051 | private const string OPERATION = "削除"; |
2011 | 2052 | |
2012 | 2053 | public FileSystemDeleteOperationRequest( |
2013 | - MainForm form, string targetTopPath1, string targetTopPath2, List<FileListEntry> targetEntries, string refreshPath) | |
2014 | - : base(form, NewUIInfo(targetEntries, OPERATION), targetTopPath1, targetTopPath2, targetEntries, refreshPath) | |
2054 | + MainForm form, string targetTopPath1, string targetTopPath2, | |
2055 | + List<FileListEntry> targetEntries, string refreshPath) | |
2056 | + : base(form, NewUIInfo(targetEntries, OPERATION), | |
2057 | + targetTopPath1, targetTopPath2, targetEntries, refreshPath) | |
2015 | 2058 | { |
2016 | 2059 | Execute = () => DeleteSelectedFiles(this); |
2017 | 2060 | } |
@@ -2025,8 +2068,10 @@ namespace FolderCategorizer.Presentation.View | ||
2025 | 2068 | public string NewName { get; private set; } |
2026 | 2069 | |
2027 | 2070 | public FileSystemRenameOperationRequest( |
2028 | - MainForm form, string targetTopPath1, string targetTopPath2, FileListEntry targetEntry, string newName, string refreshPath) | |
2029 | - : base(form, NewUIInfo(targetEntry, TARGET_SUB_TYPE, OPERATION), targetTopPath1, targetTopPath2, targetEntry, refreshPath) | |
2071 | + MainForm form, string targetTopPath1, string targetTopPath2, | |
2072 | + FileListEntry targetEntry, string newName, string refreshPath) | |
2073 | + : base(form, NewUIInfo(targetEntry, TARGET_SUB_TYPE, OPERATION), | |
2074 | + targetTopPath1, targetTopPath2, targetEntry, refreshPath) | |
2030 | 2075 | { |
2031 | 2076 | NewName = newName; |
2032 | 2077 |
@@ -2034,7 +2079,8 @@ namespace FolderCategorizer.Presentation.View | ||
2034 | 2079 | } |
2035 | 2080 | } |
2036 | 2081 | |
2037 | - public abstract class AbstractFileSystemOverwriteTimeOperationRequest : AbstractFileSystemMultiTargetOperationRequest | |
2082 | + public abstract class AbstractFileSystemOverwriteTimeOperationRequest | |
2083 | + : AbstractFileSystemMultiTargetOperationRequest | |
2038 | 2084 | { |
2039 | 2085 | protected const string OPERATION = "削除"; |
2040 | 2086 |
@@ -2050,7 +2096,8 @@ namespace FolderCategorizer.Presentation.View | ||
2050 | 2096 | } |
2051 | 2097 | } |
2052 | 2098 | |
2053 | - public class FileSystemOverwriteCreationTimeOperationRequest : AbstractFileSystemOverwriteTimeOperationRequest | |
2099 | + public class FileSystemOverwriteCreationTimeOperationRequest | |
2100 | + : AbstractFileSystemOverwriteTimeOperationRequest | |
2054 | 2101 | { |
2055 | 2102 | private const string SUB_TYPE_NAME = "作成日時"; |
2056 | 2103 |
@@ -2058,13 +2105,15 @@ namespace FolderCategorizer.Presentation.View | ||
2058 | 2105 | MainForm form, |
2059 | 2106 | string targetTopPath1, string targetTopPath2, List<FileListEntry> targetEntries, |
2060 | 2107 | string refreshPath) |
2061 | - : base(form, NewUIInfo(targetEntries, SUB_TYPE_NAME, OPERATION), targetTopPath1, targetTopPath2, targetEntries, | |
2108 | + : base(form, NewUIInfo(targetEntries, SUB_TYPE_NAME, OPERATION), | |
2109 | + targetTopPath1, targetTopPath2, targetEntries, | |
2062 | 2110 | FileSystemOperationType.OVERWRITE_CREATION_TIME, refreshPath) |
2063 | 2111 | { |
2064 | 2112 | } |
2065 | 2113 | } |
2066 | 2114 | |
2067 | - public class FileSystemOverwriteLastWriteTimeOperationRequest : AbstractFileSystemOverwriteTimeOperationRequest | |
2115 | + public class FileSystemOverwriteLastWriteTimeOperationRequest | |
2116 | + : AbstractFileSystemOverwriteTimeOperationRequest | |
2068 | 2117 | { |
2069 | 2118 | private const string SUB_TYPE_NAME = "更新日時"; |
2070 | 2119 |
@@ -2072,13 +2121,15 @@ namespace FolderCategorizer.Presentation.View | ||
2072 | 2121 | MainForm form, |
2073 | 2122 | string targetTopPath1, string targetTopPath2, List<FileListEntry> targetEntries, |
2074 | 2123 | string refreshPath) |
2075 | - : base(form, NewUIInfo(targetEntries, SUB_TYPE_NAME, OPERATION), targetTopPath1, targetTopPath2, targetEntries, | |
2124 | + : base(form, NewUIInfo(targetEntries, SUB_TYPE_NAME, OPERATION), | |
2125 | + targetTopPath1, targetTopPath2, targetEntries, | |
2076 | 2126 | FileSystemOperationType.OVERWRITE_LAST_WRITE_TIME, refreshPath) |
2077 | 2127 | { |
2078 | 2128 | } |
2079 | 2129 | } |
2080 | 2130 | |
2081 | - public class FileSystemExchangeCreationAndLastWriteTimeOperationRequest : AbstractFileSystemMultiTargetOperationRequest | |
2131 | + public class FileSystemExchangeCreationAndLastWriteTimeOperationRequest | |
2132 | + : AbstractFileSystemMultiTargetOperationRequest | |
2082 | 2133 | { |
2083 | 2134 | private const string SUB_TYPE_NAME = "作成/更新日時"; |
2084 | 2135 | private const string OPERATION = "交換"; |
@@ -2120,8 +2171,10 @@ namespace FolderCategorizer.Presentation.View | ||
2120 | 2171 | public FileListEntry NewFolderEntry { get; private set; } |
2121 | 2172 | |
2122 | 2173 | public FileSystemCreateNewFolderOperationRequest( |
2123 | - MainForm form, string targetTopPath1, string targetTopPath2, FileListEntry newFolderEntry, string refreshPath) | |
2124 | - : base(form, NewUIInfo(newFolderEntry, OPERATION), targetTopPath1, targetTopPath2, newFolderEntry, refreshPath) | |
2174 | + MainForm form, | |
2175 | + string targetTopPath1, string targetTopPath2, FileListEntry newFolderEntry, string refreshPath) | |
2176 | + : base(form, NewUIInfo(newFolderEntry, OPERATION), targetTopPath1, targetTopPath2, | |
2177 | + newFolderEntry, refreshPath) | |
2125 | 2178 | { |
2126 | 2179 | NewFolderEntry = newFolderEntry; |
2127 | 2180 |
@@ -2134,7 +2187,8 @@ namespace FolderCategorizer.Presentation.View | ||
2134 | 2187 | } |
2135 | 2188 | } |
2136 | 2189 | |
2137 | - public abstract class AbstractFileSystemMoveOrCopyOperationRequest : AbstractFileSystemMultiSrcDstOperationRequest | |
2190 | + public abstract class AbstractFileSystemMoveOrCopyOperationRequest | |
2191 | + : AbstractFileSystemMultiSrcDstOperationRequest | |
2138 | 2192 | { |
2139 | 2193 | public FileListEntry NewFolderEntry { get; set; } |
2140 | 2194 |
@@ -2162,7 +2216,8 @@ namespace FolderCategorizer.Presentation.View | ||
2162 | 2216 | MainForm form, |
2163 | 2217 | string dstFullPath1, string dstFullPath2, string srcTopPath1, string srcTopPath2, |
2164 | 2218 | List<FileListEntry> srcEntries, string dstRefreshPath, string srcRefreshPath) |
2165 | - : this(form, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, null, dstRefreshPath, srcRefreshPath) | |
2219 | + : this(form, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
2220 | + srcEntries, null, dstRefreshPath, srcRefreshPath) | |
2166 | 2221 | { |
2167 | 2222 | } |
2168 | 2223 |
@@ -2172,7 +2227,8 @@ namespace FolderCategorizer.Presentation.View | ||
2172 | 2227 | List<FileListEntry> srcEntries, FileListEntry newFolderEntry, |
2173 | 2228 | string dstRefreshPath, string srcRefreshPath) |
2174 | 2229 | : base(form, NewUIInfo(srcEntries, OPERATION), |
2175 | - dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, newFolderEntry, FileSystemOperationType.MOVE, | |
2230 | + dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
2231 | + srcEntries, newFolderEntry, FileSystemOperationType.MOVE, | |
2176 | 2232 | dstRefreshPath, srcRefreshPath) |
2177 | 2233 | { |
2178 | 2234 | } |
@@ -2186,7 +2242,8 @@ namespace FolderCategorizer.Presentation.View | ||
2186 | 2242 | MainForm form, |
2187 | 2243 | string dstFullPath1, string dstFullPath2, string srcTopPath1, string srcTopPath2, |
2188 | 2244 | List<FileListEntry> srcEntries, string dstRefreshPath, string srcRefreshPath) |
2189 | - : this(form, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, null, dstRefreshPath, srcRefreshPath) | |
2245 | + : this(form, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
2246 | + srcEntries, null, dstRefreshPath, srcRefreshPath) | |
2190 | 2247 | { |
2191 | 2248 | } |
2192 | 2249 |
@@ -2196,7 +2253,8 @@ namespace FolderCategorizer.Presentation.View | ||
2196 | 2253 | List<FileListEntry> srcEntries, FileListEntry newFolderEntry, |
2197 | 2254 | string dstRefreshPath, string srcRefreshPath) |
2198 | 2255 | : base(form, NewUIInfo(srcEntries, OPERATION), |
2199 | - dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, newFolderEntry, FileSystemOperationType.COPY, | |
2256 | + dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
2257 | + srcEntries, newFolderEntry, FileSystemOperationType.COPY, | |
2200 | 2258 | dstRefreshPath, srcRefreshPath) |
2201 | 2259 | { |
2202 | 2260 | } |
@@ -2260,7 +2318,8 @@ namespace FolderCategorizer.Presentation.View | ||
2260 | 2318 | return req.Result.AbortByTargetEmpty(); |
2261 | 2319 | } |
2262 | 2320 | |
2263 | - DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2321 | + DialogResult res = ShowTargetFileOperationConfirmMsg( | |
2322 | + targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2264 | 2323 | |
2265 | 2324 | if (res == DialogResult.No) |
2266 | 2325 | { |
@@ -2286,7 +2345,8 @@ namespace FolderCategorizer.Presentation.View | ||
2286 | 2345 | return req.Result; |
2287 | 2346 | } |
2288 | 2347 | |
2289 | - private static FileSystemOperationResult MoveOrCopySelectedFiles(AbstractFileSystemMoveOrCopyOperationRequest req) | |
2348 | + private static FileSystemOperationResult MoveOrCopySelectedFiles( | |
2349 | + AbstractFileSystemMoveOrCopyOperationRequest req) | |
2290 | 2350 | { |
2291 | 2351 | string dstPath1 = req.DstFullPath1; |
2292 | 2352 | string dstPath2 = req.DstFullPath2; |
@@ -2307,7 +2367,8 @@ namespace FolderCategorizer.Presentation.View | ||
2307 | 2367 | return req.Result.AbortByTargetEmpty(); |
2308 | 2368 | } |
2309 | 2369 | |
2310 | - DialogResult res = ShowSrcDstFileOperationConfirmMsg(dstPath1, dstPath2, srcPathsForMsg1, srcPathsForMsg2, req.UIInfo); | |
2370 | + DialogResult res = ShowSrcDstFileOperationConfirmMsg( | |
2371 | + dstPath1, dstPath2, srcPathsForMsg1, srcPathsForMsg2, req.UIInfo); | |
2311 | 2372 | |
2312 | 2373 | if (res == DialogResult.No) |
2313 | 2374 | { |
@@ -2366,16 +2427,19 @@ namespace FolderCategorizer.Presentation.View | ||
2366 | 2427 | return req.Result; |
2367 | 2428 | } |
2368 | 2429 | |
2369 | - private static FileSystemCreateNewTargetListOperationResult CreateNewFolder(FileSystemCreateNewFolderOperationRequest req) | |
2430 | + private static FileSystemCreateNewTargetListOperationResult CreateNewFolder( | |
2431 | + FileSystemCreateNewFolderOperationRequest req) | |
2370 | 2432 | { |
2371 | - FileSystemCreateNewTargetListOperationResult res = (FileSystemCreateNewTargetListOperationResult)req.Result; | |
2433 | + FileSystemCreateNewTargetListOperationResult res = | |
2434 | + (FileSystemCreateNewTargetListOperationResult)req.Result; | |
2372 | 2435 | |
2373 | 2436 | List<string> outTargetPaths1 = res.TargetPaths1; |
2374 | 2437 | List<string> outTargetPaths2 = res.TargetPaths2; |
2375 | 2438 | List<string> targetPathsForMsg1 = res.TargetPathsForMsg1; |
2376 | 2439 | List<string> targetPathsForMsg2 = res.TargetPathsForMsg2; |
2377 | 2440 | |
2378 | - if (!CreateNewTargetFileList(outTargetPaths1, outTargetPaths2, targetPathsForMsg1, targetPathsForMsg2, req)) | |
2441 | + if (!CreateNewTargetFileList( | |
2442 | + outTargetPaths1, outTargetPaths2, targetPathsForMsg1, targetPathsForMsg2, req)) | |
2379 | 2443 | { |
2380 | 2444 | return (FileSystemCreateNewTargetListOperationResult)res.Abort(); |
2381 | 2445 | } |
@@ -2385,7 +2449,8 @@ namespace FolderCategorizer.Presentation.View | ||
2385 | 2449 | return (FileSystemCreateNewTargetListOperationResult)res.AbortByTargetEmpty(); |
2386 | 2450 | } |
2387 | 2451 | |
2388 | - DialogResult confirmRes = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2452 | + DialogResult confirmRes = ShowTargetFileOperationConfirmMsg( | |
2453 | + targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2389 | 2454 | |
2390 | 2455 | if (confirmRes == DialogResult.No) |
2391 | 2456 | { |
@@ -2418,7 +2483,8 @@ namespace FolderCategorizer.Presentation.View | ||
2418 | 2483 | List<string> oldPathsForMsg1 = new List<string>(); |
2419 | 2484 | List<string> oldPathsForMsg2 = new List<string>(); |
2420 | 2485 | |
2421 | - switch (CreateExistsSingleTargetFileList(oldPaths1, oldPaths2, oldPathsForMsg1, oldPathsForMsg2, req)) | |
2486 | + switch (CreateExistsSingleTargetFileList( | |
2487 | + oldPaths1, oldPaths2, oldPathsForMsg1, oldPathsForMsg2, req)) | |
2422 | 2488 | { |
2423 | 2489 | case CreateExistsSingleTargetResult.SUCCESS: |
2424 | 2490 | case CreateExistsSingleTargetResult.IGNORE_TARGET2_NOT_FOUND_ERROR: |
@@ -2429,7 +2495,8 @@ namespace FolderCategorizer.Presentation.View | ||
2429 | 2495 | return req.Result.Abort(); |
2430 | 2496 | } |
2431 | 2497 | |
2432 | - DialogResult res = ShowSrcDstFileOperationConfirmMsg(req.NewName, req.NewName, oldPathsForMsg1, oldPathsForMsg2, req.UIInfo); | |
2498 | + DialogResult res = ShowSrcDstFileOperationConfirmMsg( | |
2499 | + req.NewName, req.NewName, oldPathsForMsg1, oldPathsForMsg2, req.UIInfo); | |
2433 | 2500 | |
2434 | 2501 | if (res == DialogResult.No) |
2435 | 2502 | { |
@@ -2455,7 +2522,8 @@ namespace FolderCategorizer.Presentation.View | ||
2455 | 2522 | return req.Result; |
2456 | 2523 | } |
2457 | 2524 | |
2458 | - private static FileSystemOperationResult OverwriteTimeSelectedFiles(AbstractFileSystemOverwriteTimeOperationRequest req) | |
2525 | + private static FileSystemOperationResult OverwriteTimeSelectedFiles( | |
2526 | + AbstractFileSystemOverwriteTimeOperationRequest req) | |
2459 | 2527 | { |
2460 | 2528 | List<string> targetPaths = new List<string>(); |
2461 | 2529 | List<string> targetPathsForMsg1 = new List<string>(); |
@@ -2472,7 +2540,8 @@ namespace FolderCategorizer.Presentation.View | ||
2472 | 2540 | return req.Result.AbortByTargetEmpty(); |
2473 | 2541 | } |
2474 | 2542 | |
2475 | - DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2543 | + DialogResult res = ShowTargetFileOperationConfirmMsg( | |
2544 | + targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2476 | 2545 | |
2477 | 2546 | if (res == DialogResult.No) |
2478 | 2547 | { |
@@ -2516,7 +2585,8 @@ namespace FolderCategorizer.Presentation.View | ||
2516 | 2585 | return req.Result.AbortByTargetEmpty(); |
2517 | 2586 | } |
2518 | 2587 | |
2519 | - DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2588 | + DialogResult res = ShowTargetFileOperationConfirmMsg( | |
2589 | + targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2520 | 2590 | |
2521 | 2591 | if (res == DialogResult.No) |
2522 | 2592 | { |
@@ -2560,7 +2630,8 @@ namespace FolderCategorizer.Presentation.View | ||
2560 | 2630 | return req.Result.AbortByTargetEmpty(); |
2561 | 2631 | } |
2562 | 2632 | |
2563 | - DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2633 | + DialogResult res = ShowTargetFileOperationConfirmMsg( | |
2634 | + targetPathsForMsg1, targetPathsForMsg2, req.UIInfo); | |
2564 | 2635 | |
2565 | 2636 | if (res == DialogResult.No) |
2566 | 2637 | { |
@@ -2611,10 +2682,14 @@ namespace FolderCategorizer.Presentation.View | ||
2611 | 2682 | { |
2612 | 2683 | string pathForMsg = PathHelper.EllipsisCompactor(path, ELLIPSIS_COMPACTOR_MAX_PATH); |
2613 | 2684 | |
2614 | - string msg1 = $"以下のフォルダは中身が空ではありません。すべて削除してよろしいですか?{DOUBLE_NEW_LINE}【{pathForMsg}】"; | |
2615 | - string msg2 = $"以下の空でないフォルダを本当に削除してよろしいですね?{DOUBLE_NEW_LINE}【{pathForMsg}】"; | |
2685 | + string msg1 = "以下のフォルダは中身が空ではありません。" + | |
2686 | + $"すべて削除してよろしいですか?{DOUBLE_NEW_LINE}【{pathForMsg}】"; | |
2616 | 2687 | |
2617 | - if ((ShowYesNoDlg(msg1, uiInfo) == DialogResult.No) || (ShowYesNoDlg(msg2, uiInfo) == DialogResult.No)) | |
2688 | + string msg2 = "以下の空でないフォルダを本当に削除してよろしいですね?" + | |
2689 | + $"{DOUBLE_NEW_LINE}【{pathForMsg}】"; | |
2690 | + | |
2691 | + if ((ShowYesNoDlg(msg1, uiInfo) == DialogResult.No) | |
2692 | + || (ShowYesNoDlg(msg2, uiInfo) == DialogResult.No)) | |
2618 | 2693 | { |
2619 | 2694 | throw new IOException("ディレクトリが空ではありません。", ERROR_DIR_NOT_EMPTY); |
2620 | 2695 | } |
@@ -2750,7 +2825,8 @@ namespace FolderCategorizer.Presentation.View | ||
2750 | 2825 | } |
2751 | 2826 | } |
2752 | 2827 | |
2753 | - private static FileSystemRawOperationResults RenameFile(string newName, string oldPath, FileSystemOperationUIInfo uiInfo) | |
2828 | + private static FileSystemRawOperationResults RenameFile( | |
2829 | + string newName, string oldPath, FileSystemOperationUIInfo uiInfo) | |
2754 | 2830 | { |
2755 | 2831 | Retry: |
2756 | 2832 | try |
@@ -2791,7 +2867,8 @@ namespace FolderCategorizer.Presentation.View | ||
2791 | 2867 | return FileSystemRawOperationResults.SUCCESS; |
2792 | 2868 | } |
2793 | 2869 | |
2794 | - private static FileSystemRawOperationResults OverwriteTimeFile(string path, AbstractFileSystemOverwriteTimeOperationRequest req) | |
2870 | + private static FileSystemRawOperationResults OverwriteTimeFile( | |
2871 | + string path, AbstractFileSystemOverwriteTimeOperationRequest req) | |
2795 | 2872 | { |
2796 | 2873 | Retry: |
2797 | 2874 | try |
@@ -3356,8 +3433,8 @@ namespace FolderCategorizer.Presentation.View | ||
3356 | 3433 | string pathForMsg = PathHelper.EllipsisCompactor(absPath2, ELLIPSIS_COMPACTOR_MAX_PATH); |
3357 | 3434 | |
3358 | 3435 | string res = ShowYesAllAbortDlg( |
3359 | - $"{LABEL_SRC_FOLDER2}に以下のファイルが存在しません。" | |
3360 | - + $"{LABEL_SRC_FOLDER1}のみ処理を続行しますか?{DOUBLE_NEW_LINE + pathForMsg}", uiInfo); | |
3436 | + $"{LABEL_SRC_FOLDER2}に以下のファイルが存在しません。" + | |
3437 | + $"{LABEL_SRC_FOLDER1}のみ処理を続行しますか?{DOUBLE_NEW_LINE + pathForMsg}", uiInfo); | |
3361 | 3438 | |
3362 | 3439 | switch (res) |
3363 | 3440 | { |
@@ -3395,7 +3472,8 @@ namespace FolderCategorizer.Presentation.View | ||
3395 | 3472 | |
3396 | 3473 | string dstTypeName = FileListEntry.ToTypeName(dstType); |
3397 | 3474 | |
3398 | - DialogResult res = ShowOperationSkipSelector(msg, LABEL_SRC_FOLDER2, dstTypeName, absPath2, uiInfo); | |
3475 | + DialogResult res = ShowOperationSkipSelector( | |
3476 | + msg, LABEL_SRC_FOLDER2, dstTypeName, absPath2, uiInfo); | |
3399 | 3477 | |
3400 | 3478 | switch (res) |
3401 | 3479 | { |
@@ -3412,7 +3490,8 @@ namespace FolderCategorizer.Presentation.View | ||
3412 | 3490 | if (!skipTarget2) |
3413 | 3491 | { |
3414 | 3492 | outTargetPaths2.Add(absPath2); |
3415 | - outTargetPathsForMsg2.Add(PathHelper.EllipsisCompactor(absPath2, ELLIPSIS_COMPACTOR_MAX_PATH)); | |
3493 | + outTargetPathsForMsg2.Add( | |
3494 | + PathHelper.EllipsisCompactor(absPath2, ELLIPSIS_COMPACTOR_MAX_PATH)); | |
3416 | 3495 | } |
3417 | 3496 | } |
3418 | 3497 | } |
@@ -3424,7 +3503,8 @@ namespace FolderCategorizer.Presentation.View | ||
3424 | 3503 | { |
3425 | 3504 | string newFolderName = CreateNewCategorizeFolderName(); |
3426 | 3505 | |
3427 | - FileListEntry newFolderEntry = new FileListEntry(newFolderName, GetCurrentRelativePath(), FileListEntry.EntryType.FOLDER); | |
3506 | + FileListEntry newFolderEntry = new FileListEntry( | |
3507 | + newFolderName, GetCurrentRelativePath(), FileListEntry.EntryType.FOLDER); | |
3428 | 3508 | |
3429 | 3509 | if (!ParseFolderDateTime(out DateTime newFolderCreationTime, cbNewFolderCreationAt.Text, "フォルダ作成日時")) |
3430 | 3510 | { |
@@ -3496,7 +3576,8 @@ namespace FolderCategorizer.Presentation.View | ||
3496 | 3576 | { |
3497 | 3577 | string absPath = PathHelper.CreateCanonicalPath(req.TargetTopPath1, req.TargetEntry.RelativePath); |
3498 | 3578 | |
3499 | - if (!CreateNewTargetFileListSub(outTargetPaths1, outTargetPathsForMsg1, req.TargetEntry, absPath, req.UIInfo, LABEL_SRC_FOLDER1)) | |
3579 | + if (!CreateNewTargetFileListSub( | |
3580 | + outTargetPaths1, outTargetPathsForMsg1, req.TargetEntry, absPath, req.UIInfo, LABEL_SRC_FOLDER1)) | |
3500 | 3581 | { |
3501 | 3582 | return false; |
3502 | 3583 | } |
@@ -3506,7 +3587,8 @@ namespace FolderCategorizer.Presentation.View | ||
3506 | 3587 | { |
3507 | 3588 | string absPath = PathHelper.CreateCanonicalPath(req.TargetTopPath2, req.TargetEntry.RelativePath); |
3508 | 3589 | |
3509 | - if (!CreateNewTargetFileListSub(outTargetPaths2, outTargetPathsForMsg2, req.TargetEntry, absPath, req.UIInfo, LABEL_SRC_FOLDER2)) | |
3590 | + if (!CreateNewTargetFileListSub( | |
3591 | + outTargetPaths2, outTargetPathsForMsg2, req.TargetEntry, absPath, req.UIInfo, LABEL_SRC_FOLDER2)) | |
3510 | 3592 | { |
3511 | 3593 | return false; |
3512 | 3594 | } |
@@ -3596,7 +3678,8 @@ namespace FolderCategorizer.Presentation.View | ||
3596 | 3678 | |
3597 | 3679 | #region UI Folder Tree Drag and Drop Operations (DFLEH) |
3598 | 3680 | |
3599 | - private void DoDragTreeView_TreeNode(ListView lv, TreeView tvSrcFolder1, TreeView tvSrcFolder2, TreeNode draggedItem) | |
3681 | + private void DoDragTreeView_TreeNode( | |
3682 | + ListView lv, TreeView tvSrcFolder1, TreeView tvSrcFolder2, TreeNode draggedItem) | |
3600 | 3683 | { |
3601 | 3684 | FileListEntry[] entries = FileListEntry.ToArrayFromTagsOf(lvFileList.SelectedItems); |
3602 | 3685 |
@@ -3605,12 +3688,14 @@ namespace FolderCategorizer.Presentation.View | ||
3605 | 3688 | // ここで強制的にドラッグされたノードを選択状態にする |
3606 | 3689 | SelectTreeViewNode(TreeNodeStatus.FromTagOf(draggedItem).RelativePath); |
3607 | 3690 | |
3608 | - TreeNodeStatus[] statuses = TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode); | |
3691 | + TreeNodeStatus[] statuses = | |
3692 | + TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode); | |
3609 | 3693 | |
3610 | 3694 | DraggedFileListEntries = new DraggedFileListEntriesHolder(entries, statuses, draggedItem); |
3611 | 3695 | } |
3612 | 3696 | |
3613 | - private DragDropEffects DragEnterTreeView_DraggedFileListEntries(DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, TreeView tv, Point p) | |
3697 | + private DragDropEffects DragEnterTreeView_DraggedFileListEntries( | |
3698 | + DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, TreeView tv, Point p) | |
3614 | 3699 | { |
3615 | 3700 | DragEnterTreeView_DraggedFileListEntries_EnterDragMode(); |
3616 | 3701 |
@@ -3624,13 +3709,15 @@ namespace FolderCategorizer.Presentation.View | ||
3624 | 3709 | IsDraggingFileListEntries = true; |
3625 | 3710 | } |
3626 | 3711 | |
3627 | - private DragDropEffects DragOverTreeView_DraggedFileListEntries_SwitchEffect(DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, TreeView tv, Point p) | |
3712 | + private DragDropEffects DragOverTreeView_DraggedFileListEntries_SwitchEffect( | |
3713 | + DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, TreeView tv, Point p) | |
3628 | 3714 | { |
3629 | 3715 | return DragOverCommon_DraggedFileListEntries_SwitchEffect(keyState, allowedEffect, |
3630 | 3716 | DragOverTreeView_DraggedFileListEntries_EmphasisDstItem(tv, p, holder.SrcFolderPaths)); |
3631 | 3717 | } |
3632 | 3718 | |
3633 | - private static bool DragOverTreeView_DraggedFileListEntries_EmphasisDstItem(TreeView tv, Point p, string[] srcFolderPaths) | |
3719 | + private static bool DragOverTreeView_DraggedFileListEntries_EmphasisDstItem( | |
3720 | + TreeView tv, Point p, string[] srcFolderPaths) | |
3634 | 3721 | { |
3635 | 3722 | TreeNode dstNode = DragDropTreeView_GetNodeAt(tv, p); |
3636 | 3723 |
@@ -3661,7 +3748,8 @@ namespace FolderCategorizer.Presentation.View | ||
3661 | 3748 | DragLeaveCommon_DraggedFileListEntries_LeaveDragMode(); |
3662 | 3749 | } |
3663 | 3750 | |
3664 | - private void DragDropTreeView_DraggedFileListEntries(DraggedFileListEntriesHolder holder, TreeView tv, Point p, DragDropEffects effect) | |
3751 | + private void DragDropTreeView_DraggedFileListEntries( | |
3752 | + DraggedFileListEntriesHolder holder, TreeView tv, Point p, DragDropEffects effect) | |
3665 | 3753 | { |
3666 | 3754 | DragLeaveCommon_DraggedFileListEntries_RestoreSelectedNodes(holder.SelectedNodeStatuses); |
3667 | 3755 |
@@ -3678,7 +3766,8 @@ namespace FolderCategorizer.Presentation.View | ||
3678 | 3766 | |
3679 | 3767 | TreeNodeStatus dstStatus = TreeNodeStatus.FromTagOf(dstNode); |
3680 | 3768 | |
3681 | - FileSystemOperationResult res = DragDropCommon_DraggedFileListEntries(dstStatus.RelativePath, holder.SrcRefreshPath, holder.DroppedEntries, effect); | |
3769 | + FileSystemOperationResult res = DragDropCommon_DraggedFileListEntries( | |
3770 | + dstStatus.RelativePath, holder.SrcRefreshPath, holder.DroppedEntries, effect); | |
3682 | 3771 | |
3683 | 3772 | // ツリー上での移動の場合、保存されているカレントはすでに削除済みであるため |
3684 | 3773 | // 移動後のノードの親をカレントとする(ファイルリスト一覧で見えるように) |
@@ -3699,17 +3788,24 @@ namespace FolderCategorizer.Presentation.View | ||
3699 | 3788 | |
3700 | 3789 | #region UI File List Drag and Drop Operations (DFLEH) |
3701 | 3790 | |
3702 | - private void DoDragDropFileList_DraggedFileListEntries_CreateEntries(ListView lv, TreeView tvSrcFolder1, TreeView tvSrcFolder2) | |
3791 | + private void DoDragDropFileList_DraggedFileListEntries_CreateEntries( | |
3792 | + ListView lv, TreeView tvSrcFolder1, TreeView tvSrcFolder2) | |
3703 | 3793 | { |
3704 | - FileListEntry[] selectedListEntries = FileListEntry.ToArrayFromTagsOf(lvFileList.SelectedItems); | |
3705 | - string[] prohibitedFolders = selectedListEntries.Where(x => x.IsFolder()).Select(x => x.RelativePath).ToArray(); | |
3794 | + FileListEntry[] selectedListEntries = | |
3795 | + FileListEntry.ToArrayFromTagsOf(lvFileList.SelectedItems); | |
3796 | + | |
3797 | + string[] prohibitedFolders = | |
3798 | + selectedListEntries.Where(x => x.IsFolder()).Select(x => x.RelativePath).ToArray(); | |
3706 | 3799 | |
3707 | - TreeNodeStatus[] selectedNodeStatuses = TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode); | |
3800 | + TreeNodeStatus[] selectedNodeStatuses = | |
3801 | + TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode); | |
3708 | 3802 | |
3709 | - DraggedFileListEntries = new DraggedFileListEntriesHolder(selectedListEntries, selectedNodeStatuses, prohibitedFolders, GetCurrentRelativePath()); | |
3803 | + DraggedFileListEntries = new DraggedFileListEntriesHolder( | |
3804 | + selectedListEntries, selectedNodeStatuses, prohibitedFolders, GetCurrentRelativePath()); | |
3710 | 3805 | } |
3711 | 3806 | |
3712 | - private DragDropEffects DragEnterFileList_DraggedFileListEntries(DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, ListView lv, Point p) | |
3807 | + private DragDropEffects DragEnterFileList_DraggedFileListEntries( | |
3808 | + DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, ListView lv, Point p) | |
3713 | 3809 | { |
3714 | 3810 | DragEnterFileList_DraggedFileListEntries_EnterDragMode(); |
3715 | 3811 |
@@ -3727,13 +3823,15 @@ namespace FolderCategorizer.Presentation.View | ||
3727 | 3823 | DisableFileCategorizeBox(); |
3728 | 3824 | } |
3729 | 3825 | |
3730 | - private DragDropEffects DragOverFileList_DraggedFileListEntries_SwitchEffect(DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, ListView lv, Point p) | |
3826 | + private DragDropEffects DragOverFileList_DraggedFileListEntries_SwitchEffect( | |
3827 | + DraggedFileListEntriesHolder holder, int keyState, DragDropEffects allowedEffect, ListView lv, Point p) | |
3731 | 3828 | { |
3732 | 3829 | return DragOverCommon_DraggedFileListEntries_SwitchEffect(keyState, allowedEffect, |
3733 | 3830 | DragOverFileList_DraggedFileListEntries_EmphasisDstItem(lv, p, holder.SrcFolderPaths)); |
3734 | 3831 | } |
3735 | 3832 | |
3736 | - private static bool DragOverFileList_DraggedFileListEntries_EmphasisDstItem(ListView lv, Point p, string[] srcFolderPaths) | |
3833 | + private static bool DragOverFileList_DraggedFileListEntries_EmphasisDstItem( | |
3834 | + ListView lv, Point p, string[] srcFolderPaths) | |
3737 | 3835 | { |
3738 | 3836 | ListViewItem dstItem = DragDropFileList_GetItemAt(lv, p); |
3739 | 3837 |
@@ -3781,7 +3879,8 @@ namespace FolderCategorizer.Presentation.View | ||
3781 | 3879 | DragLeaveCommon_DraggedFileListEntries_LeaveDragMode(); |
3782 | 3880 | } |
3783 | 3881 | |
3784 | - private void DragLeaveFileList_DraggedFileListEntries_RestoreSelectedItems(IEnumerable<FileListEntry> droppedRawEntries) | |
3882 | + private void DragLeaveFileList_DraggedFileListEntries_RestoreSelectedItems( | |
3883 | + IEnumerable<FileListEntry> droppedRawEntries) | |
3785 | 3884 | { |
3786 | 3885 | if (droppedRawEntries != null) |
3787 | 3886 | { |
@@ -3806,7 +3905,8 @@ namespace FolderCategorizer.Presentation.View | ||
3806 | 3905 | } |
3807 | 3906 | } |
3808 | 3907 | |
3809 | - private void DragDropFileList_DraggedFileListEntries(DraggedFileListEntriesHolder holder, ListView lv, Point p, DragDropEffects effect) | |
3908 | + private void DragDropFileList_DraggedFileListEntries( | |
3909 | + DraggedFileListEntriesHolder holder, ListView lv, Point p, DragDropEffects effect) | |
3810 | 3910 | { |
3811 | 3911 | FileListEntry[] srcEntries = holder.DroppedEntries; |
3812 | 3912 |
@@ -3839,7 +3939,8 @@ namespace FolderCategorizer.Presentation.View | ||
3839 | 3939 | |
3840 | 3940 | #region UI Common Drag and Drop Operations (DFLEH) |
3841 | 3941 | |
3842 | - private static DragDropEffects DragOverCommon_DraggedFileListEntries_SwitchEffect(int keyState, DragDropEffects allowedEffect, bool isValidDropTarget) | |
3942 | + private static DragDropEffects DragOverCommon_DraggedFileListEntries_SwitchEffect( | |
3943 | + int keyState, DragDropEffects allowedEffect, bool isValidDropTarget) | |
3843 | 3944 | { |
3844 | 3945 | if (!isValidDropTarget) |
3845 | 3946 | { |
@@ -3905,7 +4006,8 @@ namespace FolderCategorizer.Presentation.View | ||
3905 | 4006 | } |
3906 | 4007 | |
3907 | 4008 | return DragDropCommon_DraggedFileListEntries( |
3908 | - dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, dstRelativePath, srcRefreshPath, effect); | |
4009 | + dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
4010 | + srcEntries, dstRelativePath, srcRefreshPath, effect); | |
3909 | 4011 | } |
3910 | 4012 | |
3911 | 4013 | private FileSystemOperationResult DragDropCommon_DraggedFileListEntries( |
@@ -3916,11 +4018,13 @@ namespace FolderCategorizer.Presentation.View | ||
3916 | 4018 | { |
3917 | 4019 | case DragDropEffects.Copy: |
3918 | 4020 | return DoFileSystemOperation(new FileSystemCopyOperationRequest( |
3919 | - this, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries.ToList(), dstRefreshPath, srcRefreshPath)); | |
4021 | + this, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
4022 | + srcEntries.ToList(), dstRefreshPath, srcRefreshPath)); | |
3920 | 4023 | |
3921 | 4024 | case DragDropEffects.Move: |
3922 | 4025 | return DoFileSystemOperation(new FileSystemMoveOperationRequest( |
3923 | - this, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries.ToList(), dstRefreshPath, srcRefreshPath)); | |
4026 | + this, dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, | |
4027 | + srcEntries.ToList(), dstRefreshPath, srcRefreshPath)); | |
3924 | 4028 | |
3925 | 4029 | default: |
3926 | 4030 | return new FileSystemOperationResult(null).Abort(); |
@@ -4631,28 +4735,12 @@ namespace FolderCategorizer.Presentation.View | ||
4631 | 4735 | |
4632 | 4736 | private void tvSrcFolder_DragEnter(DragEventArgs e, TreeView tvSrcFolder) |
4633 | 4737 | { |
4634 | - //if (e.Data.GetDataPresent(DataFormats.FileDrop)) | |
4635 | - //{ | |
4636 | - // e.Effect = DragDropEffects.All; | |
4637 | - //} | |
4638 | - //else if (e.Data.GetDataPresent(typeof(DraggedFileListEntriesHolder))) | |
4639 | - //{ | |
4640 | - // e.Effect = DragEnterTreeView_DraggedFileListEntries( | |
4641 | - // (DraggedFileListEntriesHolder)e.Data.GetData(typeof(DraggedFileListEntriesHolder)), | |
4642 | - // e.KeyState, e.AllowedEffect, tvSrcFolder, new Point(e.X, e.Y)); | |
4643 | - //} | |
4644 | - //else | |
4645 | - //{ | |
4646 | - // e.Effect = DragDropEffects.None; | |
4647 | - //} | |
4648 | - | |
4649 | 4738 | bool isDataFileDrop = e.Data.GetDataPresent(DataFormats.FileDrop); |
4650 | 4739 | bool isDataSerializable = e.Data.GetDataPresent(DataFormats.Serializable); |
4651 | 4740 | |
4652 | 4741 | DragDropEffects effect = isDataFileDrop |
4653 | 4742 | ? DragDropEffects.All |
4654 | 4743 | : isDataSerializable |
4655 | - //? DragOverTreeView_DraggedFileListEntries_PreSwitchEffect(e, tvSrcFolder) | |
4656 | 4744 | ? DragEnterTreeView_DraggedFileListEntries( |
4657 | 4745 | (DraggedFileListEntriesHolder)e.Data.GetData(DataFormats.Serializable), |
4658 | 4746 | e.KeyState, e.AllowedEffect, tvSrcFolder, new Point(e.X, e.Y)) |
@@ -4660,13 +4748,6 @@ namespace FolderCategorizer.Presentation.View | ||
4660 | 4748 | |
4661 | 4749 | dropHelper.DragEnter(tvSrcFolder.PointToClient(new Point(e.X, e.Y)), effect, e.Data); |
4662 | 4750 | |
4663 | - //if (isDataSerializable) | |
4664 | - //{ | |
4665 | - // e.Effect = DragEnterTreeView_DraggedFileListEntries( | |
4666 | - // (DraggedFileListEntriesHolder)e.Data.GetData(DataFormats.Serializable), | |
4667 | - // e.KeyState, e.AllowedEffect, tvSrcFolder, new Point(e.X, e.Y)); | |
4668 | - //} | |
4669 | - | |
4670 | 4751 | e.Effect = effect; |
4671 | 4752 | } |
4672 | 4753 |
@@ -4751,8 +4832,6 @@ namespace FolderCategorizer.Presentation.View | ||
4751 | 4832 | |
4752 | 4833 | private void lvFileList_ItemDrag(object sender, ItemDragEventArgs e) |
4753 | 4834 | { |
4754 | - //Logger.Info("lvFileList_ItemDrag"); | |
4755 | - | |
4756 | 4835 | if (e.Button == MouseButtons.Left) |
4757 | 4836 | { |
4758 | 4837 | DoDragDropFileList_DraggedFileListEntries_CreateEntries(lvFileList, tvSrcFolder1, tvSrcFolder2); |
@@ -4767,12 +4846,9 @@ namespace FolderCategorizer.Presentation.View | ||
4767 | 4846 | |
4768 | 4847 | private void lvFileList_DragEnter(object sender, DragEventArgs e) |
4769 | 4848 | { |
4770 | - //Logger.Info("lvFileList_DragEnter"); | |
4771 | - | |
4772 | 4849 | bool isDataSerializable = e.Data.GetDataPresent(DataFormats.Serializable); |
4773 | 4850 | |
4774 | 4851 | DragDropEffects effect = isDataSerializable |
4775 | - //? DragOverFileList_DraggedFileListEntries_PreSwitchEffect(e, lvFileList) | |
4776 | 4852 | ? DragEnterFileList_DraggedFileListEntries( |
4777 | 4853 | (DraggedFileListEntriesHolder)e.Data.GetData(DataFormats.Serializable), |
4778 | 4854 | e.KeyState, e.AllowedEffect, lvFileList, new Point(e.X, e.Y)) |
@@ -4785,12 +4861,9 @@ namespace FolderCategorizer.Presentation.View | ||
4785 | 4861 | |
4786 | 4862 | private void lvFileList_DragOver(object sender, DragEventArgs e) |
4787 | 4863 | { |
4788 | - //Logger.Info("lvFileList_DragOver"); | |
4789 | - | |
4790 | 4864 | bool isDataSerializable = e.Data.GetDataPresent(DataFormats.Serializable); |
4791 | 4865 | |
4792 | 4866 | DragDropEffects effect = isDataSerializable |
4793 | - //? DragOverFileList_DraggedFileListEntries_PreSwitchEffect(e, lvFileList) | |
4794 | 4867 | ? DragOverFileList_DraggedFileListEntries_SwitchEffect( |
4795 | 4868 | (DraggedFileListEntriesHolder)e.Data.GetData(DataFormats.Serializable), |
4796 | 4869 | e.KeyState, e.AllowedEffect, lvFileList, new Point(e.X, e.Y)) |
@@ -4803,8 +4876,6 @@ namespace FolderCategorizer.Presentation.View | ||
4803 | 4876 | |
4804 | 4877 | private void lvFileList_DragLeave(object sender, EventArgs e) |
4805 | 4878 | { |
4806 | - //Logger.Info("lvFileList_DragLeave"); | |
4807 | - | |
4808 | 4879 | dropHelper.DragLeave(); |
4809 | 4880 | |
4810 | 4881 | DragLeaveFileList_DraggedFileListEntries(DraggedFileListEntries); |
@@ -4812,8 +4883,6 @@ namespace FolderCategorizer.Presentation.View | ||
4812 | 4883 | |
4813 | 4884 | private void lvFileList_DragDrop(object sender, DragEventArgs e) |
4814 | 4885 | { |
4815 | - //Logger.Info("lvFileList_DragDrop"); | |
4816 | - | |
4817 | 4886 | dropHelper.Drop(PointToClient(MousePosition), e.Effect, e.Data); |
4818 | 4887 | |
4819 | 4888 | if (e.Data.GetDataPresent(DataFormats.Serializable)) |