ICSharpCode.SharpZipLib.Zip.FastZipEvents.OnProcessDirectory C# (CSharp) Method

OnProcessDirectory() public method

Fires the process directory delegate.
public OnProcessDirectory ( string directory, bool hasMatchingFiles ) : bool
directory string The directory being processed.
hasMatchingFiles bool Flag indicating if the directory has matching files as determined by the current filter.
return bool
        public bool OnProcessDirectory(string directory, bool hasMatchingFiles)
        {
            bool result = true;
            EventHandler<DirectoryEventArgs> handler = ProcessDirectory;
            if (handler != null) {
                var args = new DirectoryEventArgs(directory, hasMatchingFiles);
                handler(this, args);
                result = args.ContinueRunning;
            }
            return result;
        }

Usage Example

Example #1
0
 private void ProcessDirectory(object sender, DirectoryEventArgs e)
 {
     if (!e.HasMatchingFiles && CreateEmptyDirectories)
     {
         if (events_ != null)
         {
             events_.OnProcessDirectory(e.Name, e.HasMatchingFiles);
         }
         if (e.ContinueRunning && e.Name != sourceDirectory_)
         {
             ZipEntry entry = entryFactory_.MakeDirectoryEntry(e.Name);
             outputStream_.PutNextEntry(entry);
         }
     }
 }