public virtual DirectoryPath RelativeTo(DirectoryPath directoryPath) { if (directoryPath == null) throw new ArgumentNullException("directoryPath"); if (IsRelative == false) throw new InvalidOperationException("DirectoryPath is not relative."); var newpath = System.IO.Path.Combine(directoryPath.ToString(), _path); return new DirectoryPath(newpath); }
public bool Equals(DirectoryPath other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other._path, _path); }