Exemple #1
0
		void ProcessFile(object sender, ScanEventArgs e)
		{
			if ( (_events != null) && (_events.ProcessFile != null) ) {
				_events.ProcessFile(sender, e);
			}
			
			if ( e.ContinueRunning ) {
				using( FileStream stream=File.OpenRead(e.Name) ) {
					ZipEntry entry=entryFactory_.MakeFileEntry(e.Name);
					outputStream_.PutNextEntry(entry);
					AddFileContents(e.Name, stream);
				}
			}
		}
Exemple #2
0
		/// <summary>
		/// Fires the 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;
		}
		/// <summary>
		/// Raise the complete file event
		/// </summary>
		/// <param name="file">The file name</param>
		protected void OnCompleteFile(string file)
		{
			CompletedFileHandler handler = CompletedFile;

			if (handler != null)
			{
				ScanEventArgs args = new ScanEventArgs(file);
				handler(this, args);
				_alive = args.ContinueRunning;
			}
		}
Exemple #4
0
		/// <summary>
		/// Fires the <see cref="ProcessFile">Process File delegate</see>.
		/// </summary>
		/// <param name="file">The file being processed.</param>
		/// <returns>A boolean indicating if execution should continue or not.</returns>
		public bool OnProcessFile(string file)
		{
			bool result = true;
			ProcessFileHandler handler = ProcessFile;

			if ( handler != null ) {
				ScanEventArgs args = new ScanEventArgs(file);
				ProcessFile(this, args);
				result = args.ContinueRunning;
			}
			return result;
		}
		/// <summary>
		/// Raise the ProcessFile event.
		/// </summary>
		/// <param name="file">The file name.</param>
		void OnProcessFile(string file)
		{
			ProcessFileHandler handler = ProcessFile;

			if ( handler!= null ) {
				ScanEventArgs args = new ScanEventArgs(file);
				handler(this, args);
				_alive = args.ContinueRunning;
			}
		}