Пример #1
0
 static void DeleteParentFilesIfExists(IPath path, IAbsoluteDirectoryPath backupPath)
 {
     while (path.HasParentDirectory)
     {
         path = path.ParentDirectoryPath;
         var s = path.ToString();
         if (File.Exists(s))
         {
             File.Delete(s);
             break;
         }
         if (path.Equals(backupPath))
         {
             break;
         }
     }
 }
Пример #2
0
        private bool Equals(CutSubcurve other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                (Equals(other.Source, Source) &&
                 other._touchAtFromPoint.Equals(_touchAtFromPoint) &&
                 other._touchAtToPoint.Equals(_touchAtToPoint) &&
                 (_path.Equals(other._path) ||                    // path can be reference equal
                  ((IClone)_path).IsEqual((IClone)other._path))); // or IClone.IsEqual
        }
Пример #3
0
 public bool EqualsTo(IPath path)
 {
     return(_path.Equals(path));
 }
Пример #4
0
 static void DeleteParentFilesIfExists(IPath path, IAbsoluteDirectoryPath backupPath) {
     while (path.HasParentDirectory) {
         path = path.ParentDirectoryPath;
         var s = path.ToString();
         if (File.Exists(s)) {
             File.Delete(s);
             break;
         }
         if (path.Equals(backupPath))
             break;
     }
 }