• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

ファイル整理用ツールのWinFormサンプル実装


コミットメタ情報

リビジョン033ff57d15915fce96936f57291a5f91824b5c0a (tree)
日時2018-12-26 21:08:28
作者yoshy <yoshy@user...>
コミッターyoshy

ログメッセージ

リファクタ - 不要ソース削除、折り返し調整等

変更サマリ

差分

--- a/FolderCategorizer/Presentation/View/MainForm.cs
+++ b/FolderCategorizer/Presentation/View/MainForm.cs
@@ -66,6 +66,8 @@ namespace FolderCategorizer.Presentation.View
6666
6767 private DPIHelper dpiHelper;
6868
69+ private ShellUtils.DropTarget dropHelper;
70+
6971 #endregion
7072
7173 #region UI Enabler Properties
@@ -95,8 +97,6 @@ namespace FolderCategorizer.Presentation.View
9597
9698 public string[] SrcFolderPaths { get; set; } = null;
9799
98- //public ImageList DraggedImageList { get; set; } = null;
99-
100100 public DraggedFileListEntriesHolder()
101101 {
102102 DroppedEntries = new FileListEntry[0];
@@ -105,25 +105,29 @@ namespace FolderCategorizer.Presentation.View
105105 SrcFolderPaths = new string[0];
106106 }
107107
108- public DraggedFileListEntriesHolder(FileListEntry[] selectedListEntries, TreeNodeStatus[] selectedNodeStatuses, string[] prohibitedFolders, string srcRefreshPath)
108+ public DraggedFileListEntriesHolder(
109+ FileListEntry[] selectedListEntries, TreeNodeStatus[] selectedNodeStatuses,
110+ string[] srcFolderPaths, string srcRefreshPath)
109111 {
110112 SelectedListEntries = selectedListEntries;
111113 SelectedNodeStatuses = selectedNodeStatuses;
112- SrcFolderPaths = prohibitedFolders;
114+ SrcFolderPaths = srcFolderPaths;
113115 SrcRefreshPath = srcRefreshPath;
114116
115117 DroppedEntries = SelectedListEntries;
116118 }
117119
118- public DraggedFileListEntriesHolder(FileListEntry[] selectedItems, TreeNodeStatus[] selectedNodes, TreeNode draggedNode)
120+ public DraggedFileListEntriesHolder(
121+ FileListEntry[] selectedListEntries, TreeNodeStatus[] selectedNodeStatuses, TreeNode draggedNode)
119122 {
120- SelectedListEntries = selectedItems;
121- SelectedNodeStatuses = selectedNodes;
123+ SelectedListEntries = selectedListEntries;
124+ SelectedNodeStatuses = selectedNodeStatuses;
122125
123126 SrcRefreshPath = Path.GetDirectoryName(TreeNodeStatus.FromTagOf(draggedNode).RelativePath);
124127
125128 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);
127131
128132 DroppedEntries = new FileListEntry[] { droppedEntry };
129133 SrcFolderPaths = new string[] { droppedEntry.RelativePath };
@@ -132,8 +136,6 @@ namespace FolderCategorizer.Presentation.View
132136
133137 private DraggedFileListEntriesHolder DraggedFileListEntries { get; set; } = null;
134138
135- private ShellUtils.DropTarget dropHelper = null;
136-
137139 #endregion
138140
139141 #region Tree Node Status Structures
@@ -170,7 +172,8 @@ namespace FolderCategorizer.Presentation.View
170172 {
171173 Node = node;
172174 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;
174177 }
175178
176179 public void CreateRelativePath(TreeNode parent, TreeNode current)
@@ -360,7 +363,11 @@ namespace FolderCategorizer.Presentation.View
360363
361364 public static ListViewItem CreateListViewItem(DirectoryInfo di)
362365 {
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+ };
364371
365372 ListViewItem item = new ListViewItem(texts, (int)IconNo.FOLDER)
366373 {
@@ -464,10 +471,10 @@ namespace FolderCategorizer.Presentation.View
464471 public static bool TryParseFolderCreateionDateTime(out DateTime dateTime, string str)
465472 {
466473 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);
471478 }
472479
473480 public string GetTypeName()
@@ -480,20 +487,6 @@ namespace FolderCategorizer.Presentation.View
480487 return Path.GetFileName(RelativePath);
481488 }
482489
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-
497490 public bool IsFolder()
498491 {
499492 return Type == EntryType.FOLDER;
@@ -508,6 +501,20 @@ namespace FolderCategorizer.Presentation.View
508501 {
509502 return Type == EntryType.UPWARDS;
510503 }
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; }
511518 }
512519
513520 private class FileListEntrySorter : IComparer
@@ -640,13 +647,15 @@ namespace FolderCategorizer.Presentation.View
640647 new Component[]
641648 {
642649 txtDebug, txtSrcFolder1, txtSrcFolder2,
643- cbNewFolderDate, cbNewFolderClass, cbNewFolderName, cbNewFolderCreationAt, cbNewFolderLastWriteAt,
650+ cbNewFolderDate, cbNewFolderClass, cbNewFolderName,
651+ cbNewFolderCreationAt, cbNewFolderLastWriteAt,
644652 tvSrcFolder1, tvSrcFolder2, lvFileList,
645653 statusStrip1,
646654 contextMenuStrip1,
647655 }, new Control[] {
648656 tvSrcFolder1, tvSrcFolder2, lvFileList
649- }, hiresImageList, normalImageList
657+ },
658+ hiresImageList, normalImageList
650659 );
651660
652661 dropHelper = new ShellUtils.DropTarget(lvFileList.Handle);
@@ -666,12 +675,14 @@ namespace FolderCategorizer.Presentation.View
666675
667676 #region Dialog Functions
668677
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)
670680 {
671681 return ShowOperationSkipSelector(msg, label, uiInfo.TargetType, path, uiInfo);
672682 }
673683
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)
675686 {
676687 return ShowYesNoCancelDlg(
677688 $"{msg + NEW_LINE}以下の{label}の{typeName}の{uiInfo.Operation}をスキップしますか?{DOUBLE_NEW_LINE}"
@@ -870,17 +881,20 @@ namespace FolderCategorizer.Presentation.View
870881
871882 if (targetPathsForMsg1.Count > 0)
872883 {
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);
874886 }
875887
876888 string joinedMsg2 = string.Empty;
877889
878890 if (targetPathsForMsg2.Count > 0)
879891 {
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);
881894 }
882895
883- string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?{joinedMsg1}{joinedMsg2}";
896+ string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?" +
897+ $"{joinedMsg1}{joinedMsg2}";
884898
885899 return ShowYesNoDlg(msg, uiInfo);
886900 }
@@ -895,7 +909,8 @@ namespace FolderCategorizer.Presentation.View
895909 {
896910 srcPathsForMsg1.Add("↓");
897911 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);
899914 }
900915
901916 string srcPathsJoinedMsg2 = string.Empty;
@@ -904,10 +919,12 @@ namespace FolderCategorizer.Presentation.View
904919 {
905920 srcPathsForMsg2.Add("↓");
906921 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);
908924 }
909925
910- string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?{srcPathsJoinedMsg1}{srcPathsJoinedMsg2}";
926+ string msg = $"以下の{uiInfo.TargetType}を{uiInfo.Operation}してもよろしいですか?" +
927+ $"{srcPathsJoinedMsg1}{srcPathsJoinedMsg2}";
911928
912929 return ShowYesNoDlg(msg, uiInfo);
913930 }
@@ -1160,7 +1177,9 @@ namespace FolderCategorizer.Presentation.View
11601177
11611178 private static IconNo SelectFolderIconNo(DirectoryInfo dir)
11621179 {
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);
11641183 }
11651184
11661185 private void ForceRefreshTreeViewNode(TreeNode node)
@@ -1247,7 +1266,9 @@ namespace FolderCategorizer.Presentation.View
12471266
12481267 if (childStatus.Level != TreeNodeStatus.RecursiveSearchLevel.ALL_CHILDREN_ADDED)
12491268 {
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+
12511272 node.Nodes.Insert(i + 1, refreshedChild);
12521273 node.Nodes.RemoveAt(i);
12531274 }
@@ -1549,11 +1570,13 @@ namespace FolderCategorizer.Presentation.View
15491570 {
15501571 CreateCategorizeNameParts(
15511572 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);
15531575
15541576
15551577 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,
15571580 newFolderNameDateSet, newFolderFileDateTimeAttrSet);
15581581
15591582 CreateFileCategorizeNameComboBoxes(
@@ -1563,7 +1586,8 @@ namespace FolderCategorizer.Presentation.View
15631586
15641587 private static void CreateCategorizeNameParts(
15651588 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)
15671591 {
15681592 newFolderNameDateSet = new SortedSet<string>();
15691593 newFolderNameClassSet = new SortedSet<string>();
@@ -1590,8 +1614,10 @@ namespace FolderCategorizer.Presentation.View
15901614
15911615 newFolderNameBodySet.Add(Path.GetFileNameWithoutExtension(entry.Item.Name));
15921616
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));
15951621 }
15961622 break;
15971623
@@ -1603,29 +1629,34 @@ namespace FolderCategorizer.Presentation.View
16031629
16041630 private static void ShrinkCategorizeTimeParts(
16051631 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)
16071634 {
16081635 newFolderNameDates = new List<string>(newFolderNameDateSet);
16091636 if (newFolderNameDates.Count > NEW_FOLDER_DATE_LIST_MAX * 2)
16101637 {
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();
16121642 }
16131643
16141644 newFolderCreationDateTimes = new List<string>(newFolderFileDateTimeAttrSet);
16151645 if (newFolderCreationDateTimes.Count > NEW_FOLDER_DATE_LIST_MAX)
16161646 {
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();
16181648 }
16191649
16201650 newFolderLastWriteDateTimes = new List<string>(newFolderFileDateTimeAttrSet.Reverse());
16211651 if (newFolderLastWriteDateTimes.Count > NEW_FOLDER_DATE_LIST_MAX)
16221652 {
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();
16241654 }
16251655 }
16261656
16271657 private void CreateFileCategorizeNameComboBoxes(
1628- List<string> newFolderNameDates, SortedSet<string> newFolderNameClassSet, SortedSet<string> newFolderNameBodySet,
1658+ List<string> newFolderNameDates, SortedSet<string> newFolderNameClassSet,
1659+ SortedSet<string> newFolderNameBodySet,
16291660 List<string> newFolderCreationDateTimes, List<string> newFolderLastWriteDateTimes)
16301661 {
16311662 cbNewFolderDate.Text = string.Empty;
@@ -1763,7 +1794,8 @@ namespace FolderCategorizer.Presentation.View
17631794
17641795 string targetType =
17651796 (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)}"
17671799 : (isFolder || isFile)
17681800 ? entries[0].GetTypeName()
17691801 : "無効なエントリ";
@@ -1808,7 +1840,8 @@ namespace FolderCategorizer.Presentation.View
18081840
18091841 public FileSystemOperationResult AbortByTargetEmpty()
18101842 {
1811- return Abort($"{Request.UIInfo.Operation}可能な{Request.UIInfo.TargetType}がないため、処理を中止します");
1843+ return Abort($"{Request.UIInfo.Operation}可能な" +
1844+ $"{Request.UIInfo.TargetType}がないため、処理を中止します");
18121845 }
18131846
18141847 public FileSystemOperationResult AbortWithSomeErrors()
@@ -1845,7 +1878,8 @@ namespace FolderCategorizer.Presentation.View
18451878 public List<string> TargetPathsForMsg1 { get; private set; } = new List<string>();
18461879 public List<string> TargetPathsForMsg2 { get; private set; } = new List<string>();
18471880
1848- public FileSystemCreateNewTargetListOperationResult(AbstractFileSystemOperationRequest request) : base(request)
1881+ public FileSystemCreateNewTargetListOperationResult(
1882+ AbstractFileSystemOperationRequest request) : base(request)
18491883 {
18501884 }
18511885 }
@@ -1883,12 +1917,14 @@ namespace FolderCategorizer.Presentation.View
18831917 return new FileSystemOperationUIInfo(entries, operation);
18841918 }
18851919
1886- protected static FileSystemOperationUIInfo NewUIInfo(FileListEntry entry, string subTypeName, string operation)
1920+ protected static FileSystemOperationUIInfo NewUIInfo(
1921+ FileListEntry entry, string subTypeName, string operation)
18871922 {
18881923 return new FileSystemOperationUIInfo(entry, subTypeName, operation);
18891924 }
18901925
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)
18921928 {
18931929 return new FileSystemOperationUIInfo(entries, subTypeName, operation);
18941930 }
@@ -1903,7 +1939,8 @@ namespace FolderCategorizer.Presentation.View
19031939 public string RefreshPath { get; private set; }
19041940
19051941 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)
19071944 : base(form, uiInfo)
19081945 {
19091946 TargetTopPath1 = targetTopPath1;
@@ -1965,7 +2002,8 @@ namespace FolderCategorizer.Presentation.View
19652002 }
19662003 }
19672004
1968- public abstract class AbstractFileSystemSingleTargetOperationRequest : AbstractFileSystemTargetOperationRequest
2005+ public abstract class AbstractFileSystemSingleTargetOperationRequest
2006+ : AbstractFileSystemTargetOperationRequest
19692007 {
19702008 public FileListEntry TargetEntry { get; private set; }
19712009
@@ -1978,7 +2016,8 @@ namespace FolderCategorizer.Presentation.View
19782016 }
19792017 }
19802018
1981- public abstract class AbstractFileSystemMultiTargetOperationRequest : AbstractFileSystemTargetOperationRequest
2019+ public abstract class AbstractFileSystemMultiTargetOperationRequest
2020+ : AbstractFileSystemTargetOperationRequest
19822021 {
19832022 public List<FileListEntry> TargetEntries { get; private set; }
19842023
@@ -1991,15 +2030,17 @@ namespace FolderCategorizer.Presentation.View
19912030 }
19922031 }
19932032
1994- public abstract class AbstractFileSystemMultiSrcDstOperationRequest : AbstractFileSystemSrcDstOperationRequest
2033+ public abstract class AbstractFileSystemMultiSrcDstOperationRequest
2034+ : AbstractFileSystemSrcDstOperationRequest
19952035 {
19962036 public List<FileListEntry> SrcEntries { get; private set; }
19972037
19982038 public AbstractFileSystemMultiSrcDstOperationRequest(
19992039 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)
20032044 {
20042045 SrcEntries = srcEntries;
20052046 }
@@ -2010,8 +2051,10 @@ namespace FolderCategorizer.Presentation.View
20102051 private const string OPERATION = "削除";
20112052
20122053 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)
20152058 {
20162059 Execute = () => DeleteSelectedFiles(this);
20172060 }
@@ -2025,8 +2068,10 @@ namespace FolderCategorizer.Presentation.View
20252068 public string NewName { get; private set; }
20262069
20272070 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)
20302075 {
20312076 NewName = newName;
20322077
@@ -2034,7 +2079,8 @@ namespace FolderCategorizer.Presentation.View
20342079 }
20352080 }
20362081
2037- public abstract class AbstractFileSystemOverwriteTimeOperationRequest : AbstractFileSystemMultiTargetOperationRequest
2082+ public abstract class AbstractFileSystemOverwriteTimeOperationRequest
2083+ : AbstractFileSystemMultiTargetOperationRequest
20382084 {
20392085 protected const string OPERATION = "削除";
20402086
@@ -2050,7 +2096,8 @@ namespace FolderCategorizer.Presentation.View
20502096 }
20512097 }
20522098
2053- public class FileSystemOverwriteCreationTimeOperationRequest : AbstractFileSystemOverwriteTimeOperationRequest
2099+ public class FileSystemOverwriteCreationTimeOperationRequest
2100+ : AbstractFileSystemOverwriteTimeOperationRequest
20542101 {
20552102 private const string SUB_TYPE_NAME = "作成日時";
20562103
@@ -2058,13 +2105,15 @@ namespace FolderCategorizer.Presentation.View
20582105 MainForm form,
20592106 string targetTopPath1, string targetTopPath2, List<FileListEntry> targetEntries,
20602107 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,
20622110 FileSystemOperationType.OVERWRITE_CREATION_TIME, refreshPath)
20632111 {
20642112 }
20652113 }
20662114
2067- public class FileSystemOverwriteLastWriteTimeOperationRequest : AbstractFileSystemOverwriteTimeOperationRequest
2115+ public class FileSystemOverwriteLastWriteTimeOperationRequest
2116+ : AbstractFileSystemOverwriteTimeOperationRequest
20682117 {
20692118 private const string SUB_TYPE_NAME = "更新日時";
20702119
@@ -2072,13 +2121,15 @@ namespace FolderCategorizer.Presentation.View
20722121 MainForm form,
20732122 string targetTopPath1, string targetTopPath2, List<FileListEntry> targetEntries,
20742123 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,
20762126 FileSystemOperationType.OVERWRITE_LAST_WRITE_TIME, refreshPath)
20772127 {
20782128 }
20792129 }
20802130
2081- public class FileSystemExchangeCreationAndLastWriteTimeOperationRequest : AbstractFileSystemMultiTargetOperationRequest
2131+ public class FileSystemExchangeCreationAndLastWriteTimeOperationRequest
2132+ : AbstractFileSystemMultiTargetOperationRequest
20822133 {
20832134 private const string SUB_TYPE_NAME = "作成/更新日時";
20842135 private const string OPERATION = "交換";
@@ -2120,8 +2171,10 @@ namespace FolderCategorizer.Presentation.View
21202171 public FileListEntry NewFolderEntry { get; private set; }
21212172
21222173 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)
21252178 {
21262179 NewFolderEntry = newFolderEntry;
21272180
@@ -2134,7 +2187,8 @@ namespace FolderCategorizer.Presentation.View
21342187 }
21352188 }
21362189
2137- public abstract class AbstractFileSystemMoveOrCopyOperationRequest : AbstractFileSystemMultiSrcDstOperationRequest
2190+ public abstract class AbstractFileSystemMoveOrCopyOperationRequest
2191+ : AbstractFileSystemMultiSrcDstOperationRequest
21382192 {
21392193 public FileListEntry NewFolderEntry { get; set; }
21402194
@@ -2162,7 +2216,8 @@ namespace FolderCategorizer.Presentation.View
21622216 MainForm form,
21632217 string dstFullPath1, string dstFullPath2, string srcTopPath1, string srcTopPath2,
21642218 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)
21662221 {
21672222 }
21682223
@@ -2172,7 +2227,8 @@ namespace FolderCategorizer.Presentation.View
21722227 List<FileListEntry> srcEntries, FileListEntry newFolderEntry,
21732228 string dstRefreshPath, string srcRefreshPath)
21742229 : base(form, NewUIInfo(srcEntries, OPERATION),
2175- dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, newFolderEntry, FileSystemOperationType.MOVE,
2230+ dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2,
2231+ srcEntries, newFolderEntry, FileSystemOperationType.MOVE,
21762232 dstRefreshPath, srcRefreshPath)
21772233 {
21782234 }
@@ -2186,7 +2242,8 @@ namespace FolderCategorizer.Presentation.View
21862242 MainForm form,
21872243 string dstFullPath1, string dstFullPath2, string srcTopPath1, string srcTopPath2,
21882244 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)
21902247 {
21912248 }
21922249
@@ -2196,7 +2253,8 @@ namespace FolderCategorizer.Presentation.View
21962253 List<FileListEntry> srcEntries, FileListEntry newFolderEntry,
21972254 string dstRefreshPath, string srcRefreshPath)
21982255 : base(form, NewUIInfo(srcEntries, OPERATION),
2199- dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, newFolderEntry, FileSystemOperationType.COPY,
2256+ dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2,
2257+ srcEntries, newFolderEntry, FileSystemOperationType.COPY,
22002258 dstRefreshPath, srcRefreshPath)
22012259 {
22022260 }
@@ -2260,7 +2318,8 @@ namespace FolderCategorizer.Presentation.View
22602318 return req.Result.AbortByTargetEmpty();
22612319 }
22622320
2263- DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
2321+ DialogResult res = ShowTargetFileOperationConfirmMsg(
2322+ targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
22642323
22652324 if (res == DialogResult.No)
22662325 {
@@ -2286,7 +2345,8 @@ namespace FolderCategorizer.Presentation.View
22862345 return req.Result;
22872346 }
22882347
2289- private static FileSystemOperationResult MoveOrCopySelectedFiles(AbstractFileSystemMoveOrCopyOperationRequest req)
2348+ private static FileSystemOperationResult MoveOrCopySelectedFiles(
2349+ AbstractFileSystemMoveOrCopyOperationRequest req)
22902350 {
22912351 string dstPath1 = req.DstFullPath1;
22922352 string dstPath2 = req.DstFullPath2;
@@ -2307,7 +2367,8 @@ namespace FolderCategorizer.Presentation.View
23072367 return req.Result.AbortByTargetEmpty();
23082368 }
23092369
2310- DialogResult res = ShowSrcDstFileOperationConfirmMsg(dstPath1, dstPath2, srcPathsForMsg1, srcPathsForMsg2, req.UIInfo);
2370+ DialogResult res = ShowSrcDstFileOperationConfirmMsg(
2371+ dstPath1, dstPath2, srcPathsForMsg1, srcPathsForMsg2, req.UIInfo);
23112372
23122373 if (res == DialogResult.No)
23132374 {
@@ -2366,16 +2427,19 @@ namespace FolderCategorizer.Presentation.View
23662427 return req.Result;
23672428 }
23682429
2369- private static FileSystemCreateNewTargetListOperationResult CreateNewFolder(FileSystemCreateNewFolderOperationRequest req)
2430+ private static FileSystemCreateNewTargetListOperationResult CreateNewFolder(
2431+ FileSystemCreateNewFolderOperationRequest req)
23702432 {
2371- FileSystemCreateNewTargetListOperationResult res = (FileSystemCreateNewTargetListOperationResult)req.Result;
2433+ FileSystemCreateNewTargetListOperationResult res =
2434+ (FileSystemCreateNewTargetListOperationResult)req.Result;
23722435
23732436 List<string> outTargetPaths1 = res.TargetPaths1;
23742437 List<string> outTargetPaths2 = res.TargetPaths2;
23752438 List<string> targetPathsForMsg1 = res.TargetPathsForMsg1;
23762439 List<string> targetPathsForMsg2 = res.TargetPathsForMsg2;
23772440
2378- if (!CreateNewTargetFileList(outTargetPaths1, outTargetPaths2, targetPathsForMsg1, targetPathsForMsg2, req))
2441+ if (!CreateNewTargetFileList(
2442+ outTargetPaths1, outTargetPaths2, targetPathsForMsg1, targetPathsForMsg2, req))
23792443 {
23802444 return (FileSystemCreateNewTargetListOperationResult)res.Abort();
23812445 }
@@ -2385,7 +2449,8 @@ namespace FolderCategorizer.Presentation.View
23852449 return (FileSystemCreateNewTargetListOperationResult)res.AbortByTargetEmpty();
23862450 }
23872451
2388- DialogResult confirmRes = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
2452+ DialogResult confirmRes = ShowTargetFileOperationConfirmMsg(
2453+ targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
23892454
23902455 if (confirmRes == DialogResult.No)
23912456 {
@@ -2418,7 +2483,8 @@ namespace FolderCategorizer.Presentation.View
24182483 List<string> oldPathsForMsg1 = new List<string>();
24192484 List<string> oldPathsForMsg2 = new List<string>();
24202485
2421- switch (CreateExistsSingleTargetFileList(oldPaths1, oldPaths2, oldPathsForMsg1, oldPathsForMsg2, req))
2486+ switch (CreateExistsSingleTargetFileList(
2487+ oldPaths1, oldPaths2, oldPathsForMsg1, oldPathsForMsg2, req))
24222488 {
24232489 case CreateExistsSingleTargetResult.SUCCESS:
24242490 case CreateExistsSingleTargetResult.IGNORE_TARGET2_NOT_FOUND_ERROR:
@@ -2429,7 +2495,8 @@ namespace FolderCategorizer.Presentation.View
24292495 return req.Result.Abort();
24302496 }
24312497
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);
24332500
24342501 if (res == DialogResult.No)
24352502 {
@@ -2455,7 +2522,8 @@ namespace FolderCategorizer.Presentation.View
24552522 return req.Result;
24562523 }
24572524
2458- private static FileSystemOperationResult OverwriteTimeSelectedFiles(AbstractFileSystemOverwriteTimeOperationRequest req)
2525+ private static FileSystemOperationResult OverwriteTimeSelectedFiles(
2526+ AbstractFileSystemOverwriteTimeOperationRequest req)
24592527 {
24602528 List<string> targetPaths = new List<string>();
24612529 List<string> targetPathsForMsg1 = new List<string>();
@@ -2472,7 +2540,8 @@ namespace FolderCategorizer.Presentation.View
24722540 return req.Result.AbortByTargetEmpty();
24732541 }
24742542
2475- DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
2543+ DialogResult res = ShowTargetFileOperationConfirmMsg(
2544+ targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
24762545
24772546 if (res == DialogResult.No)
24782547 {
@@ -2516,7 +2585,8 @@ namespace FolderCategorizer.Presentation.View
25162585 return req.Result.AbortByTargetEmpty();
25172586 }
25182587
2519- DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
2588+ DialogResult res = ShowTargetFileOperationConfirmMsg(
2589+ targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
25202590
25212591 if (res == DialogResult.No)
25222592 {
@@ -2560,7 +2630,8 @@ namespace FolderCategorizer.Presentation.View
25602630 return req.Result.AbortByTargetEmpty();
25612631 }
25622632
2563- DialogResult res = ShowTargetFileOperationConfirmMsg(targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
2633+ DialogResult res = ShowTargetFileOperationConfirmMsg(
2634+ targetPathsForMsg1, targetPathsForMsg2, req.UIInfo);
25642635
25652636 if (res == DialogResult.No)
25662637 {
@@ -2611,10 +2682,14 @@ namespace FolderCategorizer.Presentation.View
26112682 {
26122683 string pathForMsg = PathHelper.EllipsisCompactor(path, ELLIPSIS_COMPACTOR_MAX_PATH);
26132684
2614- string msg1 = $"以下のフォルダは中身が空ではありません。すべて削除してよろしいですか?{DOUBLE_NEW_LINE}【{pathForMsg}】";
2615- string msg2 = $"以下の空でないフォルダを本当に削除してよろしいですね?{DOUBLE_NEW_LINE}【{pathForMsg}】";
2685+ string msg1 = "以下のフォルダは中身が空ではありません。" +
2686+ $"すべて削除してよろしいですか?{DOUBLE_NEW_LINE}【{pathForMsg}】";
26162687
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))
26182693 {
26192694 throw new IOException("ディレクトリが空ではありません。", ERROR_DIR_NOT_EMPTY);
26202695 }
@@ -2750,7 +2825,8 @@ namespace FolderCategorizer.Presentation.View
27502825 }
27512826 }
27522827
2753- private static FileSystemRawOperationResults RenameFile(string newName, string oldPath, FileSystemOperationUIInfo uiInfo)
2828+ private static FileSystemRawOperationResults RenameFile(
2829+ string newName, string oldPath, FileSystemOperationUIInfo uiInfo)
27542830 {
27552831 Retry:
27562832 try
@@ -2791,7 +2867,8 @@ namespace FolderCategorizer.Presentation.View
27912867 return FileSystemRawOperationResults.SUCCESS;
27922868 }
27932869
2794- private static FileSystemRawOperationResults OverwriteTimeFile(string path, AbstractFileSystemOverwriteTimeOperationRequest req)
2870+ private static FileSystemRawOperationResults OverwriteTimeFile(
2871+ string path, AbstractFileSystemOverwriteTimeOperationRequest req)
27952872 {
27962873 Retry:
27972874 try
@@ -3356,8 +3433,8 @@ namespace FolderCategorizer.Presentation.View
33563433 string pathForMsg = PathHelper.EllipsisCompactor(absPath2, ELLIPSIS_COMPACTOR_MAX_PATH);
33573434
33583435 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);
33613438
33623439 switch (res)
33633440 {
@@ -3395,7 +3472,8 @@ namespace FolderCategorizer.Presentation.View
33953472
33963473 string dstTypeName = FileListEntry.ToTypeName(dstType);
33973474
3398- DialogResult res = ShowOperationSkipSelector(msg, LABEL_SRC_FOLDER2, dstTypeName, absPath2, uiInfo);
3475+ DialogResult res = ShowOperationSkipSelector(
3476+ msg, LABEL_SRC_FOLDER2, dstTypeName, absPath2, uiInfo);
33993477
34003478 switch (res)
34013479 {
@@ -3412,7 +3490,8 @@ namespace FolderCategorizer.Presentation.View
34123490 if (!skipTarget2)
34133491 {
34143492 outTargetPaths2.Add(absPath2);
3415- outTargetPathsForMsg2.Add(PathHelper.EllipsisCompactor(absPath2, ELLIPSIS_COMPACTOR_MAX_PATH));
3493+ outTargetPathsForMsg2.Add(
3494+ PathHelper.EllipsisCompactor(absPath2, ELLIPSIS_COMPACTOR_MAX_PATH));
34163495 }
34173496 }
34183497 }
@@ -3424,7 +3503,8 @@ namespace FolderCategorizer.Presentation.View
34243503 {
34253504 string newFolderName = CreateNewCategorizeFolderName();
34263505
3427- FileListEntry newFolderEntry = new FileListEntry(newFolderName, GetCurrentRelativePath(), FileListEntry.EntryType.FOLDER);
3506+ FileListEntry newFolderEntry = new FileListEntry(
3507+ newFolderName, GetCurrentRelativePath(), FileListEntry.EntryType.FOLDER);
34283508
34293509 if (!ParseFolderDateTime(out DateTime newFolderCreationTime, cbNewFolderCreationAt.Text, "フォルダ作成日時"))
34303510 {
@@ -3496,7 +3576,8 @@ namespace FolderCategorizer.Presentation.View
34963576 {
34973577 string absPath = PathHelper.CreateCanonicalPath(req.TargetTopPath1, req.TargetEntry.RelativePath);
34983578
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))
35003581 {
35013582 return false;
35023583 }
@@ -3506,7 +3587,8 @@ namespace FolderCategorizer.Presentation.View
35063587 {
35073588 string absPath = PathHelper.CreateCanonicalPath(req.TargetTopPath2, req.TargetEntry.RelativePath);
35083589
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))
35103592 {
35113593 return false;
35123594 }
@@ -3596,7 +3678,8 @@ namespace FolderCategorizer.Presentation.View
35963678
35973679 #region UI Folder Tree Drag and Drop Operations (DFLEH)
35983680
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)
36003683 {
36013684 FileListEntry[] entries = FileListEntry.ToArrayFromTagsOf(lvFileList.SelectedItems);
36023685
@@ -3605,12 +3688,14 @@ namespace FolderCategorizer.Presentation.View
36053688 // ここで強制的にドラッグされたノードを選択状態にする
36063689 SelectTreeViewNode(TreeNodeStatus.FromTagOf(draggedItem).RelativePath);
36073690
3608- TreeNodeStatus[] statuses = TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode);
3691+ TreeNodeStatus[] statuses =
3692+ TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode);
36093693
36103694 DraggedFileListEntries = new DraggedFileListEntriesHolder(entries, statuses, draggedItem);
36113695 }
36123696
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)
36143699 {
36153700 DragEnterTreeView_DraggedFileListEntries_EnterDragMode();
36163701
@@ -3624,13 +3709,15 @@ namespace FolderCategorizer.Presentation.View
36243709 IsDraggingFileListEntries = true;
36253710 }
36263711
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)
36283714 {
36293715 return DragOverCommon_DraggedFileListEntries_SwitchEffect(keyState, allowedEffect,
36303716 DragOverTreeView_DraggedFileListEntries_EmphasisDstItem(tv, p, holder.SrcFolderPaths));
36313717 }
36323718
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)
36343721 {
36353722 TreeNode dstNode = DragDropTreeView_GetNodeAt(tv, p);
36363723
@@ -3661,7 +3748,8 @@ namespace FolderCategorizer.Presentation.View
36613748 DragLeaveCommon_DraggedFileListEntries_LeaveDragMode();
36623749 }
36633750
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)
36653753 {
36663754 DragLeaveCommon_DraggedFileListEntries_RestoreSelectedNodes(holder.SelectedNodeStatuses);
36673755
@@ -3678,7 +3766,8 @@ namespace FolderCategorizer.Presentation.View
36783766
36793767 TreeNodeStatus dstStatus = TreeNodeStatus.FromTagOf(dstNode);
36803768
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);
36823771
36833772 // ツリー上での移動の場合、保存されているカレントはすでに削除済みであるため
36843773 // 移動後のノードの親をカレントとする(ファイルリスト一覧で見えるように)
@@ -3699,17 +3788,24 @@ namespace FolderCategorizer.Presentation.View
36993788
37003789 #region UI File List Drag and Drop Operations (DFLEH)
37013790
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)
37033793 {
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();
37063799
3707- TreeNodeStatus[] selectedNodeStatuses = TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode);
3800+ TreeNodeStatus[] selectedNodeStatuses =
3801+ TreeNodeStatus.ToArrayFromTagsOf(tvSrcFolder1.SelectedNode, tvSrcFolder2.SelectedNode);
37083802
3709- DraggedFileListEntries = new DraggedFileListEntriesHolder(selectedListEntries, selectedNodeStatuses, prohibitedFolders, GetCurrentRelativePath());
3803+ DraggedFileListEntries = new DraggedFileListEntriesHolder(
3804+ selectedListEntries, selectedNodeStatuses, prohibitedFolders, GetCurrentRelativePath());
37103805 }
37113806
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)
37133809 {
37143810 DragEnterFileList_DraggedFileListEntries_EnterDragMode();
37153811
@@ -3727,13 +3823,15 @@ namespace FolderCategorizer.Presentation.View
37273823 DisableFileCategorizeBox();
37283824 }
37293825
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)
37313828 {
37323829 return DragOverCommon_DraggedFileListEntries_SwitchEffect(keyState, allowedEffect,
37333830 DragOverFileList_DraggedFileListEntries_EmphasisDstItem(lv, p, holder.SrcFolderPaths));
37343831 }
37353832
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)
37373835 {
37383836 ListViewItem dstItem = DragDropFileList_GetItemAt(lv, p);
37393837
@@ -3781,7 +3879,8 @@ namespace FolderCategorizer.Presentation.View
37813879 DragLeaveCommon_DraggedFileListEntries_LeaveDragMode();
37823880 }
37833881
3784- private void DragLeaveFileList_DraggedFileListEntries_RestoreSelectedItems(IEnumerable<FileListEntry> droppedRawEntries)
3882+ private void DragLeaveFileList_DraggedFileListEntries_RestoreSelectedItems(
3883+ IEnumerable<FileListEntry> droppedRawEntries)
37853884 {
37863885 if (droppedRawEntries != null)
37873886 {
@@ -3806,7 +3905,8 @@ namespace FolderCategorizer.Presentation.View
38063905 }
38073906 }
38083907
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)
38103910 {
38113911 FileListEntry[] srcEntries = holder.DroppedEntries;
38123912
@@ -3839,7 +3939,8 @@ namespace FolderCategorizer.Presentation.View
38393939
38403940 #region UI Common Drag and Drop Operations (DFLEH)
38413941
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)
38433944 {
38443945 if (!isValidDropTarget)
38453946 {
@@ -3905,7 +4006,8 @@ namespace FolderCategorizer.Presentation.View
39054006 }
39064007
39074008 return DragDropCommon_DraggedFileListEntries(
3908- dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2, srcEntries, dstRelativePath, srcRefreshPath, effect);
4009+ dstFullPath1, dstFullPath2, srcTopPath1, srcTopPath2,
4010+ srcEntries, dstRelativePath, srcRefreshPath, effect);
39094011 }
39104012
39114013 private FileSystemOperationResult DragDropCommon_DraggedFileListEntries(
@@ -3916,11 +4018,13 @@ namespace FolderCategorizer.Presentation.View
39164018 {
39174019 case DragDropEffects.Copy:
39184020 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));
39204023
39214024 case DragDropEffects.Move:
39224025 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));
39244028
39254029 default:
39264030 return new FileSystemOperationResult(null).Abort();
@@ -4631,28 +4735,12 @@ namespace FolderCategorizer.Presentation.View
46314735
46324736 private void tvSrcFolder_DragEnter(DragEventArgs e, TreeView tvSrcFolder)
46334737 {
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-
46494738 bool isDataFileDrop = e.Data.GetDataPresent(DataFormats.FileDrop);
46504739 bool isDataSerializable = e.Data.GetDataPresent(DataFormats.Serializable);
46514740
46524741 DragDropEffects effect = isDataFileDrop
46534742 ? DragDropEffects.All
46544743 : isDataSerializable
4655- //? DragOverTreeView_DraggedFileListEntries_PreSwitchEffect(e, tvSrcFolder)
46564744 ? DragEnterTreeView_DraggedFileListEntries(
46574745 (DraggedFileListEntriesHolder)e.Data.GetData(DataFormats.Serializable),
46584746 e.KeyState, e.AllowedEffect, tvSrcFolder, new Point(e.X, e.Y))
@@ -4660,13 +4748,6 @@ namespace FolderCategorizer.Presentation.View
46604748
46614749 dropHelper.DragEnter(tvSrcFolder.PointToClient(new Point(e.X, e.Y)), effect, e.Data);
46624750
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-
46704751 e.Effect = effect;
46714752 }
46724753
@@ -4751,8 +4832,6 @@ namespace FolderCategorizer.Presentation.View
47514832
47524833 private void lvFileList_ItemDrag(object sender, ItemDragEventArgs e)
47534834 {
4754- //Logger.Info("lvFileList_ItemDrag");
4755-
47564835 if (e.Button == MouseButtons.Left)
47574836 {
47584837 DoDragDropFileList_DraggedFileListEntries_CreateEntries(lvFileList, tvSrcFolder1, tvSrcFolder2);
@@ -4767,12 +4846,9 @@ namespace FolderCategorizer.Presentation.View
47674846
47684847 private void lvFileList_DragEnter(object sender, DragEventArgs e)
47694848 {
4770- //Logger.Info("lvFileList_DragEnter");
4771-
47724849 bool isDataSerializable = e.Data.GetDataPresent(DataFormats.Serializable);
47734850
47744851 DragDropEffects effect = isDataSerializable
4775- //? DragOverFileList_DraggedFileListEntries_PreSwitchEffect(e, lvFileList)
47764852 ? DragEnterFileList_DraggedFileListEntries(
47774853 (DraggedFileListEntriesHolder)e.Data.GetData(DataFormats.Serializable),
47784854 e.KeyState, e.AllowedEffect, lvFileList, new Point(e.X, e.Y))
@@ -4785,12 +4861,9 @@ namespace FolderCategorizer.Presentation.View
47854861
47864862 private void lvFileList_DragOver(object sender, DragEventArgs e)
47874863 {
4788- //Logger.Info("lvFileList_DragOver");
4789-
47904864 bool isDataSerializable = e.Data.GetDataPresent(DataFormats.Serializable);
47914865
47924866 DragDropEffects effect = isDataSerializable
4793- //? DragOverFileList_DraggedFileListEntries_PreSwitchEffect(e, lvFileList)
47944867 ? DragOverFileList_DraggedFileListEntries_SwitchEffect(
47954868 (DraggedFileListEntriesHolder)e.Data.GetData(DataFormats.Serializable),
47964869 e.KeyState, e.AllowedEffect, lvFileList, new Point(e.X, e.Y))
@@ -4803,8 +4876,6 @@ namespace FolderCategorizer.Presentation.View
48034876
48044877 private void lvFileList_DragLeave(object sender, EventArgs e)
48054878 {
4806- //Logger.Info("lvFileList_DragLeave");
4807-
48084879 dropHelper.DragLeave();
48094880
48104881 DragLeaveFileList_DraggedFileListEntries(DraggedFileListEntries);
@@ -4812,8 +4883,6 @@ namespace FolderCategorizer.Presentation.View
48124883
48134884 private void lvFileList_DragDrop(object sender, DragEventArgs e)
48144885 {
4815- //Logger.Info("lvFileList_DragDrop");
4816-
48174886 dropHelper.Drop(PointToClient(MousePosition), e.Effect, e.Data);
48184887
48194888 if (e.Data.GetDataPresent(DataFormats.Serializable))