CmisSync.Lib.PathMatcher.PathMatcher.CanCreateLocalPath C# (CSharp) Метод

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

Determines whether this instance can create local path for specified remotePath.
public CanCreateLocalPath ( IDocument remoteDocument ) : bool
remoteDocument IDocument Remote document.
Результат bool
        public bool CanCreateLocalPath(IDocument remoteDocument)
        {
            foreach (string remotePath in remoteDocument.Paths)
            {
                if (this.CanCreateLocalPath(remotePath)) {
                    return true;
                }
            }

            return false;
        }

Same methods

PathMatcher::CanCreateLocalPath ( IFolder remoteFolder ) : bool
PathMatcher::CanCreateLocalPath ( string remotePath ) : bool

Usage Example

Пример #1
0
 public void CanCreateLocalPathTest()
 {
     string remote = this.remotepath + "/test";
     string wrong = "/wrong/path/on/server/test";
     var matcher = new PathMatcher(this.localpath, this.remotepath);
     Assert.IsTrue(matcher.CanCreateLocalPath(this.remotepath));
     Assert.IsTrue(matcher.CanCreateLocalPath(remote));
     Assert.IsFalse(matcher.CanCreateLocalPath(wrong));
     var remoteFolder = new Mock<IFolder>();
     remoteFolder.Setup(f => f.Path).Returns(this.remotepath + "/test2");
     Assert.IsTrue(matcher.CanCreateLocalPath(remoteFolder.Object));
     var wrongFolder = new Mock<IFolder>();
     wrongFolder.Setup(f => f.Path).Returns(wrong + "/test2");
     Assert.IsFalse(matcher.CanCreateLocalPath(wrongFolder.Object));
 }