@@ -13,22 +13,13 @@ namespace CopyFolderTool
1313 public partial class MainWindow : Window
1414 {
1515
16- static string strExeFilePath = System . Reflection . Assembly . GetExecutingAssembly ( ) . Location ;
17- static string strWorkPath = System . IO . Path . GetDirectoryName ( strExeFilePath ) ;
18- static string strSettingsFilePath = System . IO . Path . Combine ( strWorkPath , "Paths.config" ) ;
19-
2016 public MainWindow ( )
2117 {
2218 InitializeComponent ( ) ;
2319
2420 if ( App . mArgs != null && App . mArgs . Length > 0 )
2521 {
2622 fieldSource . Text = checkForBackslash ( App . mArgs [ 0 ] ) ;
27- int filesCount = getFilesCount ( fieldSource . Text ) ;
28- if ( filesCount > 0 )
29- {
30- fileCountNotice . Text = "Source folder contains " + filesCount + " files." ;
31- }
3223 }
3324
3425 loadSettings ( ) ;
@@ -196,11 +187,6 @@ private void selectFolder(object sender, RoutedEventArgs e)
196187 {
197188 case "btn_SourcePath" :
198189 fieldSource . Text = dialog . FileName ;
199- int filesCount = getFilesCount ( fieldSource . Text ) ;
200- if ( filesCount > 0 )
201- {
202- fileCountNotice . Text = "Source folder contains " + filesCount + " files." ;
203- }
204190 break ;
205191 case "btn_DestinationPath" :
206192 fieldDestination . Text = dialog . FileName ;
@@ -230,19 +216,6 @@ private string checkForBackslash(string inputStr)
230216 }
231217 }
232218
233- private static int getFilesCount ( string path )
234- {
235- try
236- {
237- var filesCount = Directory . GetFiles ( @path , "*.*" , SearchOption . AllDirectories ) . Count ( ) ;
238- return filesCount ;
239- }
240- catch
241- {
242- return 0 ;
243- }
244- }
245-
246219 private void loadSettings ( )
247220 {
248221 fieldLogfile . Text = UserSettings . Default . logFilePath ;
0 commit comments