@@ -16,16 +16,9 @@ public static class FileHelper
1616 private static BackgroundWorker transferWorker ;
1717 private static List < XciItem > xciTransfers = new List < XciItem > ( ) ;
1818
19- public struct FileStruct
20- {
21- public FileAction action ;
22- public string destinationPath ;
23- public string sourcePath ;
24- public XciHelper . XciLocation source ;
25- public XciHelper . XciLocation destination ;
26- public bool actionCompleted ;
27- public bool actionSuccess ;
28- }
19+ public static formMain formMain ;
20+
21+ public static bool isTransferInProgress ;
2922
3023 public enum FileAction
3124 {
@@ -41,8 +34,16 @@ public enum FileAction
4134 ShowRenameWindow
4235 }
4336
44- public static formMain formMain ;
45- public static bool isTransferInProgress ;
37+ public struct FileStruct
38+ {
39+ public FileAction action ;
40+ public bool actionCompleted ;
41+ public bool actionSuccess ;
42+ public XciHelper . XciLocation destination ;
43+ public string destinationPath ;
44+ public XciHelper . XciLocation source ;
45+ public string sourcePath ;
46+ }
4647
4748 private static void CustomCopy_OnComplete ( bool Canceled )
4849 {
@@ -79,7 +80,7 @@ private static void TransferWorker_DoWork(object sender, DoWorkEventArgs e)
7980 customCopy . Copy ( ) ;
8081
8182 transferredFiles ++ ;
82-
83+
8384 lock ( lockObject )
8485 xciTransfers . Remove ( xciAction ) ;
8586
@@ -118,12 +119,6 @@ private static void TransferWorker_RunWorkerCompleted(object sender, RunWorkerCo
118119 //XciHelper.LoadXcis();
119120 }
120121
121- public static void StopTransfers ( )
122- {
123- if ( transferWorker . IsBusy )
124- transferWorker . CancelAsync ( ) ;
125- }
126-
127122 public static bool IsXciInTransferList ( XciItem xci )
128123 {
129124 lock ( lockObject )
@@ -135,9 +130,14 @@ public static bool IsXciInTransferList(XciItem xci)
135130 return false ;
136131 }
137132
138- public static bool TransferXci ( XciItem xci )
133+ public static void StopTransfers ( )
139134 {
135+ if ( transferWorker . IsBusy )
136+ transferWorker . CancelAsync ( ) ;
137+ }
140138
139+ public static bool TransferXci ( XciItem xci )
140+ {
141141 if ( xci . fileAction . action != FileAction . Copy &&
142142 xci . fileAction . action != FileAction . Move )
143143 return false ;
@@ -166,7 +166,6 @@ public static bool TransferXci(XciItem xci)
166166 else
167167 xci . fileAction . destinationPath = Path . Combine ( Settings . config . sdDriveLetter , Path . GetFileName ( xci . fileAction . sourcePath ) ) ;
168168
169-
170169 if ( String . IsNullOrWhiteSpace ( xci . fileAction . sourcePath ) || String . IsNullOrWhiteSpace ( xci . fileAction . destinationPath ) )
171170 return false ;
172171
0 commit comments