Esempio n. 1
0
        public static void DeleteFileFolder(object sender, DeletePerformedEventArgs eventArgs)
        {
            OnDeletePerformed(null, eventArgs);

            var directories = Directory.GetDirectories(eventArgs.Path);

            foreach (var path in directories)
            {
                if (eventArgs.FileNameToDelete != string.Empty)
                {
                    var files = Directory.GetFiles(path).TakeWhile(_ => _.Contains(eventArgs.FileNameToDelete));
                    foreach (var file in files)
                    {
                        File.Delete(file);
                    }
                }

                Console.WriteLine(path);
                WriteInfo(path);
            }
            OnDeleteCompleted();
        }
Esempio n. 2
0
        protected static void OnDeletePerformed(object sender, DeletePerformedEventArgs eventArgs)
        {
            var del = DeletePerformed;

            del?.Invoke(null, eventArgs);
        }
Esempio n. 3
0
 public FileSystemTraverse(Action <object, DeletePerformedEventArgs> toDelete, DeletePerformedEventArgs eventArgs)
 {
     toDelete(this, eventArgs);
 }