示例#1
0
        private void ApplyEventArgsChanges(FileSystemVisitorEventArgs args)
        {
            switch (args.State)
            {
            case FileSystemVisitorEventArgsStates.None:
                break;

            case FileSystemVisitorEventArgsStates.StopOnFirstFindedCoincidence:
                this.action = FileSystemVisitorAction.Interrupt;
                break;

            case FileSystemVisitorEventArgsStates.IgnoreThisEntry:
                this.action = FileSystemVisitorAction.Ignore;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(args.State), args.State, "FileSystemVisitorEventArgs state is out of range");
            }
        }
示例#2
0
 private void InvokeConsiderFilter(FileSystemVisitorIgnoreOnDefaultFilterEvent ev, object obj, FileSystemVisitorEventArgs args)
 {
     if (this.Filter != FileSystemVisitor.DefaultFilter)
     {
         ev?.Invoke(obj, args);
         this.ApplyEventArgsChanges(args);
     }
 }
示例#3
0
 private void InvokeConsiderFilter(FileSystemVisitorEvent ev, object obj, FileSystemVisitorEventArgs args)
 {
     ev?.Invoke(obj, args);
     this.ApplyEventArgsChanges(args);
 }