本文整理汇总了C#中ICSharpCode.SharpZipLib.Core.ScanEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ScanEventArgs类的具体用法?C# ScanEventArgs怎么用?C# ScanEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScanEventArgs类属于ICSharpCode.SharpZipLib.Core命名空间,在下文中一共展示了ScanEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCompleteFile
private void OnCompleteFile(string file)
{
CompletedFileHandler completedFile = this.CompletedFile;
if (completedFile != null)
{
ScanEventArgs e = new ScanEventArgs(file);
completedFile(this, e);
this.alive_ = e.ContinueRunning;
}
}
示例2: OnCompletedFile
public bool OnCompletedFile(string file)
{
bool continueRunning = true;
CompletedFileHandler completedFile = this.CompletedFile;
if (completedFile != null)
{
ScanEventArgs e = new ScanEventArgs(file);
completedFile(this, e);
continueRunning = e.ContinueRunning;
}
return continueRunning;
}
示例3: OnProcessFile
public bool OnProcessFile(string file)
{
bool continueRunning = true;
ProcessFileHandler processFile = this.ProcessFile;
if (processFile != null)
{
ScanEventArgs e = new ScanEventArgs(file);
processFile(this, e);
continueRunning = e.ContinueRunning;
}
return continueRunning;
}
示例4: OnProcessFile
/// <summary>
/// Raises the ProcessFileEvent.
/// </summary>
/// <param name="file">The file for this event.</param>
public void OnProcessFile(string file)
{
if ( ProcessFile != null ) {
ScanEventArgs args = new ScanEventArgs(file);
ProcessFile(this, args);
}
}
示例5: ProcessFile
void ProcessFile(object sender, ScanEventArgs e)
{
if ( (events_ != null) && (events_.ProcessFile != null) ) {
events_.ProcessFile(sender, e);
}
if ( e.ContinueRunning ) {
ZipEntry entry = entryFactory_.MakeFileEntry(e.Name);
outputStream_.PutNextEntry(entry);
AddFileContents(e.Name);
}
}
示例6: ProcessFile
void ProcessFile(object sender, ScanEventArgs e)
{
Console.WriteLine(e.Name);
}
示例7: OnCompletedFile
/// <summary>
/// Fires the <see cref="CompletedFile"/> delegate
/// </summary>
/// <param name="file">The file whose processing has been completed.</param>
/// <returns>A boolean indicating if execution should continue or not.</returns>
public bool OnCompletedFile(string file)
{
bool result = true;
CompletedFileHandler handler = CompletedFile;
if ( handler != null ) {
ScanEventArgs args = new ScanEventArgs(file);
handler(this, args);
result = args.ContinueRunning;
}
return result;
}
示例8: OnCompleteFile
/// <summary>
/// Raise the complete file event
/// </summary>
/// <param name="file">The file name</param>
void OnCompleteFile(string file)
{
CompletedFileHandler handler = CompletedFile;
if (handler != null)
{
ScanEventArgs args = new ScanEventArgs(file);
handler(this, args);
alive_ = args.ContinueRunning;
}
}
示例9: OnProcessFile
/// <summary>
/// Raise the ProcessFile event.
/// </summary>
/// <param name="file">The file name.</param>
public void OnProcessFile(string file)
{
if ( ProcessFile != null ) {
ScanEventArgs args = new ScanEventArgs(file);
ProcessFile(this, args);
alive_ = args.ContinueRunning;
}
}
示例10: OnProcessFile
private void OnProcessFile(string file)
{
ProcessFileHandler processFile = this.ProcessFile;
if (processFile != null)
{
ScanEventArgs e = new ScanEventArgs(file);
processFile(this, e);
this.alive_ = e.ContinueRunning;
}
}
示例11: ProcessFileMethod
private void ProcessFileMethod(object sender, ScanEventArgs args)
{
_uptoFileCount++;
int percentCompleted = _uptoFileCount * 100 / _totalFileCount;
// do something here with a progress bar
// file counts are easier as sizes take more work to calculate, and compression levels vary by file type
string fileName = args.Name;
// To terminate the process, set args.ContinueRunning = false
if (fileName == "stop on this file")
args.ContinueRunning = false;
}
示例12: ProcessFile
private void ProcessFile(object sender, ScanEventArgs e)
{
_output.Output("Processing file: " + e.Name);
}
示例13: ProcessFile
private void ProcessFile(object sender, ScanEventArgs e)
{
if ((this.events_ != null) && (this.events_.ProcessFile != null))
{
this.events_.ProcessFile(sender, e);
}
if (e.ContinueRunning)
{
try
{
using (FileStream stream = File.Open(e.Name, FileMode.Open, FileAccess.Read, FileShare.Read))
{
ZipEntry entry = this.entryFactory_.MakeFileEntry(e.Name);
this.outputStream_.PutNextEntry(entry);
this.AddFileContents(e.Name, stream);
}
}
catch (Exception exception)
{
if (this.events_ == null)
{
this.continueRunning_ = false;
throw;
}
this.continueRunning_ = this.events_.OnFileFailure(e.Name, exception);
}
}
}
示例14: ProcessFile
/// <summary>
/// Callback for adding a new file.
/// </summary>
/// <param name="sender">The scanner calling this delegate.</param>
/// <param name="args">The event arguments.</param>
void ProcessFile(object sender, ScanEventArgs args)
{
if ( !silent_ )
{
Console.WriteLine(args.Name);
}
activeZipFile_.Add(args.Name);
}
示例15: ProcessFile
/// <summary>
/// Callback for adding a new file.
/// </summary>
/// <param name="sender">The scanner calling this delegate.</param>
/// <param name="args">The event arguments.</param>
void ProcessFile(object sender, ScanEventArgs args)
{
activeZipFile_.Add(args.Name);
}