@@ -212,29 +212,26 @@ internal static DropZone ImportFiles(DropZone c)
212212 string fileName = pathArryBySlash . Last ( ) ;
213213
214214 // Copy file to output directory of the container
215- if ( ! c . Contains ( c . OutputFilePath + " \\ " + fileName ) )
215+ if ( c . Extensions . Contains ( pathArray . Last ( ) ) || c . Extensions . Length == 0 )
216216 {
217- if ( c . Extensions . Contains ( pathArray . Last ( ) ) || c . Extensions . Length == 0 )
217+ try
218218 {
219- try
220- {
221- File . Copy ( path , c . OutputFilePath + "\\ " + fileName , true ) ;
222- c . AddFile ( c . OutputFilePath + "\\ " + fileName ) ;
223- // Add file path to the container
224- Debugger . Send ( $ "File { fileName } received successfully", ConsoleColor . Green ) ;
225- }
226- catch
227- {
228- Debugger . Send ( $ "File could not be received, either wrong destination ({ c . OutputFilePath } ) or unsuitable source file ({ path } ))", ConsoleColor . Yellow ) ;
229- }
219+ File . Copy ( path , c . OutputFilePath + "\\ " + fileName , true ) ;
220+ c . AddFile ( c . OutputFilePath + "\\ " + fileName ) ;
221+ // Add file path to the container
222+ Debugger . Send ( $ "File { fileName } received successfully", ConsoleColor . Green ) ;
230223 }
231- else
232- {
233- string err = "File could not be received, required extension(s):" ;
234- for ( int i = 0 ; i < c . Extensions . Length ; i ++ ) err += $ " .{ c . Extensions [ i ] } ";
235- Debugger . Send ( err , ConsoleColor . Yellow ) ;
224+ catch
225+ {
226+ Debugger . Send ( $ "File could not be received, either wrong destination ({ c . OutputFilePath } ) or unsuitable source file ({ path } ))", ConsoleColor . Yellow ) ;
236227 }
237228 }
229+ else
230+ {
231+ string err = "File could not be received, required extension(s):" ;
232+ for ( int i = 0 ; i < c . Extensions . Length ; i ++ ) err += $ " .{ c . Extensions [ i ] } ";
233+ Debugger . Send ( err , ConsoleColor . Yellow ) ;
234+ }
238235 UnloadDroppedFiles ( filePathList ) ;
239236
240237 // Return modified container
0 commit comments