Пример #1
0
        /// <summary>
        /// Raise the DirectoryFailure event.
        /// </summary>
        /// <param name="directory">The directory name.</param>
        /// <param name="e">The exception detected.</param>
        bool OnDirectoryFailure(string directory, Exception e)
        {
            DirectoryFailureHandler handler = DirectoryFailure;
            bool result = (handler != null);

            if (result)
            {
                ScanFailureEventArgs args = new ScanFailureEventArgs(directory, e);
                handler(this, args);
                alive_ = args.ContinueRunning;
            }
            return(result);
        }
Пример #2
0
        /// <summary>
        /// Raise the FileFailure event.
        /// </summary>
        /// <param name="file">The file name.</param>
        /// <param name="e">The exception detected.</param>
        bool OnFileFailure(string file, Exception e)
        {
            FileFailureHandler handler = FileFailure;

            bool result = (handler != null);

            if (result)
            {
                ScanFailureEventArgs args = new ScanFailureEventArgs(file, e);
                FileFailure(this, args);
                alive_ = args.ContinueRunning;
            }
            return(result);
        }
Пример #3
0
        /// <summary>
        /// Raise the <see cref="DirectoryFailure">directory failure</see> event.
        /// </summary>
        /// <param name="directory">The directory causing the failure.</param>
        /// <param name="e">The exception for this event.</param>
        /// <returns>A boolean indicating if execution should continue or not.</returns>
        public bool OnDirectoryFailure(string directory, Exception e)
        {
            bool result = false;
            DirectoryFailureHandler handler = DirectoryFailure;

            if (handler != null)
            {
                ScanFailureEventArgs args = new ScanFailureEventArgs(directory, e);
                handler(this, args);
                result = args.ContinueRunning;
            }
            return result;
        }
Пример #4
0
        /// <summary>
        /// Fires the <see cref="FileFailure"> file failure handler delegate</see>.
        /// </summary>
        /// <param name="file">The file causing the failure.</param>
        /// <param name="e">The exception for this failure.</param>
        /// <returns>A boolean indicating if execution should continue or not.</returns>
        public bool OnFileFailure(string file, Exception e)
        {
            FileFailureHandler handler = FileFailure;
            bool result = (handler != null);

            if (result)
            {
                ScanFailureEventArgs args = new ScanFailureEventArgs(file, e);
                handler(this, args);
                result = args.ContinueRunning;
            }
            return result;
        }
 /// <summary>
 /// Raise the DirectoryFailure event.
 /// </summary>
 /// <param name="directory">The directory name.</param>
 /// <param name="e">The exception detected.</param>
 bool OnDirectoryFailure(string directory, Exception e)
 {
     DirectoryFailureHandler handler = DirectoryFailure;
     bool result = (handler != null);
     if (result)
     {
         ScanFailureEventArgs args = new ScanFailureEventArgs(directory, e);
         handler(this, args);
         alive_ = args.ContinueRunning;
     }
     return result;
 }