Skip to content

Commit

Permalink
Summary comment updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jfreilly committed Aug 2, 2005
1 parent 92b5ec7 commit dd8480d
Show file tree
Hide file tree
Showing 12 changed files with 250 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("0.83.3.0")]
[assembly: AssemblyVersion("0.84.0.0")]

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("../ICSharpCode.SharpZipLib.key")]
2 changes: 1 addition & 1 deletion src/Checksums/StrangeCRC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public class StrangeCRC : IChecksum
int globalCrc;

/// <summary>
/// Initialise a default instance of <see cref="StrangeCrc"></see>
/// Initialise a default instance of <see cref="StrangeCRC"></see>
/// </summary>
public StrangeCRC()
{
Expand Down
104 changes: 98 additions & 6 deletions src/Core/FileSystemScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@

namespace ICSharpCode.SharpZipLib.Core
{
/// <summary>
/// Event arguments for scanning.
/// </summary>
public class ScanEventArgs : EventArgs
{
/// <summary>
/// Initialise a new instance of <see cref="ScanEventArgs"/>
/// </summary>
/// <param name="name"></param>
public ScanEventArgs(string name)
{
this.name = name;
Expand All @@ -49,35 +56,44 @@ public ScanEventArgs(string name)

string name;

/// <summary>
/// The name for this event.
/// </summary>
public string Name
{
get { return name; }
}

bool continueRunning;

/// <summary>
/// Get set a value indicating if scanning should continue or not.
/// </summary>
public bool ContinueRunning
{
get { return continueRunning; }
set { continueRunning = value; }
}
}

/// <summary>
/// Event arguments for directories.
/// </summary>
public class DirectoryEventArgs : ScanEventArgs
{
/// <summary>
/// Initialize an instance of <see cref="DirectoryEventsArgs"></see>.
/// Initialize an instance of <see cref="DirectoryEventArgs"></see>.
/// </summary>
/// <param name="name">The name for this directory.</param>
/// <param name="isEmpty">Flag value indicating if any matching files are contained in this directory.</param>
/// <param name="hasMatchingFiles">Flag value indicating if any matching files are contained in this directory.</param>
public DirectoryEventArgs(string name, bool hasMatchingFiles)
: base (name)
{
this.hasMatchingFiles = hasMatchingFiles;
}

/// <summary>
/// Geta value indicating if the directory contains any matching files or not.
/// Get a value indicating if the directory contains any matching files or not.
/// </summary>
public bool HasMatchingFiles
{
Expand All @@ -87,8 +103,16 @@ public bool HasMatchingFiles
bool hasMatchingFiles;
}

/// <summary>
/// Arguments passed when scan failures are detected.
/// </summary>
public class ScanFailureEventArgs
{
/// <summary>
/// Initialise a new instance of <see cref="ScanFailureEventArgs"></see>
/// </summary>
/// <param name="name">The name to apply.</param>
/// <param name="e">The exception to use.</param>
public ScanFailureEventArgs(string name, Exception e)
{
this.name = name;
Expand All @@ -97,29 +121,55 @@ public ScanFailureEventArgs(string name, Exception e)
}

string name;

/// <summary>
/// The applicable name.
/// </summary>
public string Name
{
get { return name; }
}

Exception exception;

/// <summary>
/// The applicable exception.
/// </summary>
public Exception Exception
{
get { return exception; }
}

bool continueRunning;

/// <summary>
/// Get / set a value indicating wether scanning should continue.
/// </summary>
public bool ContinueRunning
{
get { return continueRunning; }
set { continueRunning = value; }
}
}

/// <summary>
/// Delegate invokked when a directory is processed.
/// </summary>
public delegate void ProcessDirectoryDelegate(object Sender, DirectoryEventArgs e);

/// <summary>
/// Delegate invoked when a file is processed.
/// </summary>
public delegate void ProcessFileDelegate(object sender, ScanEventArgs e);

/// <summary>
/// Delegate invoked when a directory failure is detected.
/// </summary>
public delegate void DirectoryFailureDelegate(object sender, ScanFailureEventArgs e);

/// <summary>
/// Delegate invoked when a file failure is detected.
/// </summary>
public delegate void FileFailureDelegate(object sender, ScanFailureEventArgs e);

/// <summary>
Expand All @@ -128,7 +178,7 @@ public bool ContinueRunning
public class FileSystemScanner
{
/// <summary>
/// Initialise a new instance of <see cref="FileScanner"></see>
/// Initialise a new instance of <see cref="FileSystemScanner"></see>
/// </summary>
/// <param name="filter">The file filter to apply when scanning.</param>
public FileSystemScanner(string filter)
Expand All @@ -139,31 +189,59 @@ public FileSystemScanner(string filter)
/// <summary>
/// Initialise a new instance of <see cref="FileSystemScanner"></see>
/// </summary>
/// <param name="fileFilter"></param>
/// <param name="fileFilter">The file <see cref="NameFilter"></see>filter to apply.</param>
/// <param name="directoryFilter">The directory <see cref="NameFilter"></see>filter to apply.</param>
public FileSystemScanner(string fileFilter, string directoryFilter)
{
this.fileFilter = new PathFilter(fileFilter);
this.directoryFilter = new PathFilter(directoryFilter);
}

/// <summary>
/// Initialise a new instance of <see cref="FileSystemScanner"></see>
/// </summary>
/// <param name="fileFilter">The file <see cref="NameFilter"></see>filter to apply.</param>
public FileSystemScanner(IScanFilter fileFilter)
{
this.fileFilter = fileFilter;
}

/// <summary>
/// Initialise a new instance of <see cref="FileSystemScanner"></see>
/// </summary>
/// <param name="fileFilter">The file <see cref="IScanFilter"></see>filter to apply.</param>
/// <param name="directoryFilter">The directory <see cref="IScanFilter"></see>filter to apply.</param>
public FileSystemScanner(IScanFilter fileFilter, IScanFilter directoryFilter)
{
this.fileFilter = fileFilter;
this.directoryFilter = directoryFilter;
}

/// <summary>
/// Delegate to invoke when a directory is processed.
/// </summary>
public ProcessDirectoryDelegate ProcessDirectory;

/// <summary>
/// Delegate to invoke when a file is processed.
/// </summary>
public ProcessFileDelegate ProcessFile;

/// <summary>
/// Delegate to invoke when a directory failure is detected.
/// </summary>
public DirectoryFailureDelegate DirectoryFailure;

/// <summary>
/// Delegate to invoke when a file failure is detected.
/// </summary>
public FileFailureDelegate FileFailure;

/// <summary>
/// Raise the DirectoryFailure event.
/// </summary>
/// <param name="directory">Rhe directory name.</param>
/// <param name="e">The exception detected.</param>
public void OnDirectoryFailure(string directory, Exception e)
{
if ( DirectoryFailure == null ) {
Expand All @@ -175,6 +253,11 @@ public void OnDirectoryFailure(string directory, Exception e)
}
}

/// <summary>
/// Raise the FileFailure event.
/// </summary>
/// <param name="file">The file name.</param>
/// <param name="e">The exception detected.</param>
public void OnFileFailure(string file, Exception e)
{
if ( FileFailure == null ) {
Expand All @@ -185,7 +268,11 @@ public void OnFileFailure(string file, Exception e)
alive = args.ContinueRunning;
}
}


/// <summary>
/// Raise the ProcessFile event.
/// </summary>
/// <param name="file">The file name.</param>
public void OnProcessFile(string file)
{
if ( ProcessFile != null ) {
Expand All @@ -195,6 +282,11 @@ public void OnProcessFile(string file)
}
}

/// <summary>
/// Raise the ProcessDirectory event.
/// </summary>
/// <param name="directory">The directory name.</param>
/// <param name="hasMatchingFiles">Flag indicating if the directory has matching files.</param>
public void OnProcessDirectory(string directory, bool hasMatchingFiles)
{
if ( ProcessDirectory != null ) {
Expand Down
2 changes: 1 addition & 1 deletion src/Core/NameFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public NameFilter(string filter)
/// Test a string to see if it is a valid regular expression.
/// </summary>
/// <param name="e">The expression to test.</param>
/// <returns>True if expression is a valid <see cref="RegEx"/> false otherwise.</returns>
/// <returns>True if expression is a valid <see cref="System.Text.RegularExpressions.Regex"/> false otherwise.</returns>
public static bool IsValidExpression(string e)
{
bool result = true;
Expand Down
24 changes: 22 additions & 2 deletions src/Core/PathFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,30 @@ public virtual bool IsMatch(string name)
NameFilter nameFilter;
#endregion
}


/// <summary>
/// NameAnsSizeFilter filters based on name and file size.
/// </summary>
public class NameAndSizeFilter : PathFilter
{


/// <summary>
/// Initialise a new instance of NameAndSizeFilter.
/// </summary>
/// <param name="filter">The filter to apply.</param>
/// <param name="minSize">The minimum file size to include.</param>
/// <param name="maxSize">The maximum file size to include.</param>
public NameAndSizeFilter(string filter, long minSize, long maxSize) : base(filter)
{
this.minSize = minSize;
this.maxSize = maxSize;
}

/// <summary>
/// Test a filename to see if it matches the filter.
/// </summary>
/// <param name="fileName">The filename to test.</param>
/// <returns>True if the filter matches, false otherwise.</returns>
public override bool IsMatch(string fileName)
{
FileInfo fileInfo = new FileInfo(fileName);
Expand All @@ -100,6 +114,9 @@ public override bool IsMatch(string fileName)

long minSize = 0;

/// <summary>
/// The minimum size for a file that will match this filter.
/// </summary>
public long MinSize
{
get { return minSize; }
Expand All @@ -108,6 +125,9 @@ public long MinSize

long maxSize = long.MaxValue;

/// <summary>
/// The maximum size for a file that will match this filter.
/// </summary>
public long MaxSize
{
get { return maxSize; }
Expand Down
20 changes: 18 additions & 2 deletions src/Encryption/PkzipClassic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class PkzipClassicEncryptCryptoTransform : PkzipClassicCryptoBase, ICryptoTransf
/// <summary>
/// Initialise a new instance of <see cref="PkzipClassicEncryptCryptoTransform"></see>
/// </summary>
/// <param name="keyBlock">The key block to <see cref="SetKeys"></see>with.</param>
/// <param name="keyBlock">The key block to use.</param>
internal PkzipClassicEncryptCryptoTransform(byte[] keyBlock)
{
SetKeys(keyBlock);
Expand Down Expand Up @@ -267,7 +267,7 @@ class PkzipClassicDecryptCryptoTransform : PkzipClassicCryptoBase, ICryptoTransf
/// <summary>
/// Initialise a new instance of <see cref="PkzipClassicDecryptCryptoTransform"></see>.
/// </summary>
/// <param name="keyBlock">The key block to <see cref="SetKeys"></see> with.</param>
/// <param name="keyBlock">The key block to decrypt with.</param>
internal PkzipClassicDecryptCryptoTransform(byte[] keyBlock)
{
SetKeys(keyBlock);
Expand Down Expand Up @@ -370,6 +370,10 @@ public void Dispose()
/// </summary>
public sealed class PkzipClassicManaged : PkzipClassic
{
/// <summary>
/// Get / set the applicable block size.
/// </summary>
/// <remarks>The only valid block size is 8.</remarks>
public override int BlockSize
{
get { return 8; }
Expand All @@ -379,6 +383,9 @@ public override int BlockSize
}
}

/// <summary>
/// Get an array of legal <see cref="KeySizes">key sizes.</see>
/// </summary>
public override KeySizes[] LegalKeySizes
{
get {
Expand All @@ -388,11 +395,17 @@ public override KeySizes[] LegalKeySizes
}
}

/// <summary>
/// Generate an initial vector.
/// </summary>
public override void GenerateIV()
{
// Do nothing.
}

/// <summary>
/// Get an array of legal <see cref="KeySizes">block sizes</see>.
/// </summary>
public override KeySizes[] LegalBlockSizes
{
get {
Expand All @@ -404,6 +417,9 @@ public override KeySizes[] LegalBlockSizes

byte[] key;

/// <summary>
/// Get / set the key value applicable.
/// </summary>
public override byte[] Key
{
get {
Expand Down
Loading

0 comments on commit dd8480d

Please sign in to comment.