コード例 #1
0
        private bool OkToDeleteFile(FolderTrimmer.FolderDeletionInfo folderInfo, string fileName)
        {
            string relativePath = (string)folderInfo.Context;
            string pathOnLocalNode;

            if (string.IsNullOrEmpty(relativePath))
            {
                pathOnLocalNode = Path.Combine(this.sourceFolderName, fileName);
            }
            else
            {
                pathOnLocalNode = Path.Combine(
                    this.sourceFolderName,
                    relativePath,
                    fileName);
            }

            return(FabricFile.Exists(pathOnLocalNode));
        }
コード例 #2
0
 private void SetFolderDeletionContext(FolderTrimmer.FolderDeletionInfo folderInfo, FolderTrimmer.FolderDeletionInfo parentFolderInfo, string folderNameWithoutPath)
 {
     if (null == parentFolderInfo)
     {
         folderInfo.Context = string.Empty;
     }
     else
     {
         string parentRelativePath = (string)parentFolderInfo.Context;
         if (string.IsNullOrEmpty(parentRelativePath))
         {
             folderInfo.Context = folderNameWithoutPath;
         }
         else
         {
             folderInfo.Context = Path.Combine(parentRelativePath, folderNameWithoutPath);
         }
     }
 }