public static string GetComputedFile(this CodeGenerationFileOptionsElement @this, string rootPath) { if (string.IsNullOrEmpty(rootPath)) { rootPath = Environment.CurrentDirectory; } if (!Path.IsPathRooted(rootPath)) { rootPath = Path.Combine(Environment.CurrentDirectory, rootPath); } string fullPath = Path.Combine(Path.GetDirectoryName(rootPath), @this.Filename); // replace the pattern "\.\" with just "\", as in "C:\Files\.\Another.cs" fullPath = fullPath.Replace("\\.\\", "\\"); return(fullPath); }
public static string GetComputedPath(this CodeGenerationFileOptionsElement @this, string rootPath) { return(Path.GetPathRoot(GetComputedPath(@this, rootPath))); }