4 using System.Collections.Generic;
 
    7 using System.Runtime.InteropServices;
 
    9 using System.Text.RegularExpressions;
 
   10 using System.Threading.Tasks;
 
   12 namespace SiliconStudio.BuildEngine
 
   18             if (
string.IsNullOrWhiteSpace(path))
 
   24                 Path.GetFullPath(path);
 
   36             var path = 
new StringBuilder(260); 
 
   37             if (
string.IsNullOrWhiteSpace(absolutePath))
 
   40             string sourcePath = 
new DirectoryInfo(absolutePath).FullName;
 
   41             absoluteRoot = 
new DirectoryInfo(absoluteRoot).FullName;
 
   42             return PathRelativePathTo(path, absoluteRoot, FILE_ATTRIBUTE_DIRECTORY, sourcePath, FILE_ATTRIBUTE_DIRECTORY) == 0 ? sourcePath : path.ToString();
 
   46         private const int FILE_ATTRIBUTE_DIRECTORY = 0x10;
 
   50         [DllImport(
"shlwapi.dll", SetLastError = 
true)]
 
   51         private static extern int PathRelativePathTo(StringBuilder pszPath, 
string pszFrom, 
int dwAttrFrom, 
string pszTo, 
int dwAttrTo);
 
static bool IsValidPath(string path)
static string GetRelativePath(string absoluteRoot, string absolutePath)