CmisSync.Lib.Filter.IgnoredFolderNameFilter.CheckFolderName C# (CSharp) Метод

CheckFolderName() публичный Метод

Checks the name of the folder.
public CheckFolderName ( string name, string &reason ) : bool
name string Name of the folder.
reason string Reason why true was returned.
Результат bool
        public virtual bool CheckFolderName(string name, out string reason) {
            lock (this.listLock) {
                reason = string.Empty;
                foreach (Regex wildcard in this.wildcards) {
                    if (wildcard.IsMatch(name)) {
                        reason = string.Format("Folder \"{0}\" matches regex {1}", name, wildcard.ToString());
                        return true;
                    }
                }
            }

            return false;
        }
    }

Usage Example

 public void FilterLetsEventsPassIfNotMatchingWildcard() {
     var wildcards = new List<string>();
     wildcards.Add(".tmp");
     var filter = new IgnoredFolderNameFilter { Wildcards = wildcards };
     string reason;
     Assert.That(filter.CheckFolderName(".cache", out reason), Is.False);
     Assert.That(string.IsNullOrEmpty(reason), Is.True);
 }
All Usage Examples Of CmisSync.Lib.Filter.IgnoredFolderNameFilter::CheckFolderName
IgnoredFolderNameFilter