Beispiel #1
0
        public override object Clone()
        {
            IFileSystemWatcher clonedEncapsWatcher = InternalWatcher.Clone() as IFileSystemWatcher;
            FileSystemAutoRefreshingWatcher clonedAutoRefreshingWatcher = new FileSystemAutoRefreshingWatcher(clonedEncapsWatcher);

            // Add current refresher's policies to the cloned one
            clonedAutoRefreshingWatcher.ClearPolicies();
            foreach (var policy in _errorHandlingPolicies)
            {
                clonedAutoRefreshingWatcher.AddPolicy(policy);
            }
            return(clonedAutoRefreshingWatcher);
        }
 public override object Clone()
 {
     IFileSystemWatcher clonedEncapsWatcher = InternalWatcher.Clone() as IFileSystemWatcher;
     FileSystemAutoRefreshingWatcher clonedAutoRefreshingWatcher = new FileSystemAutoRefreshingWatcher(clonedEncapsWatcher);
     // Add current refresher's policies to the cloned one
     clonedAutoRefreshingWatcher.ClearPolicies();
     foreach (var policy in _errorHandlingPolicies)
     {
         clonedAutoRefreshingWatcher.AddPolicy(policy);
     }
     return clonedAutoRefreshingWatcher;
 }