Beispiel #1
0
 public FilePath PathFrom(FilePath from) {
     if (!from.isDirectory)
     {
         return PathFrom(from.Parent);
     }
     if (isAbsolute)
     {
         return new FilePath(WorkOutRelativePath(from.Path, this.Path, 0), this.IsDirectory, false);
     }
     return this;
 }
Beispiel #2
0
 public FilePath ToAbsolutePath(FilePath from) {
     if (isAbsolute)
     {
         return this;
     }
     if (!from.isDirectory)
     {
         return ToAbsolutePath(from.Parent);
     }
     return new FilePath(System.IO.Path.Combine(from.Path, this.Path), this.IsDirectory, true);
 }
Beispiel #3
0
	    private static FilePath FindScript(FilePath path, string file)
	    {
            var searchPath = path.File(file);
	        if (File.Exists(searchPath.Path))
	        {
                return searchPath;
	        }
            searchPath = path.Directory("Scripts").File(file);
            if (File.Exists(searchPath.Path)) {
                return searchPath;
            }
            var parent = path.Parent;
            if (parent == null)
            {
                return null;
            }
            return FindScript(parent, file);
	    }
Beispiel #4
0
 public XmlFile(FilePath filePath)
 {
     this.filePath = filePath;
 }
Beispiel #5
0
        public static ExternalSolutionApi GetSolutionFile(string path)
		{
            var parser = new SolutionFileParser();
            var filePath = new FilePath(path, false);
            return new ExternalSolutionApi(parser.Parse(filePath, filePath.FileContent().AsLines()));
		}