public Optional <AbsoluteFilePath> GetDefaultApplicationForFile(AbsoluteFilePath fileName) { var pathRes = new StringBuilder(); var res = FindExecutable(fileName.ToString(), null, pathRes); return(res > 32 ? Optional.Some(AbsoluteFilePath.Parse(pathRes.ToString())) : Optional.None <AbsoluteFilePath>()); }
private static XmlProject DeserializeProjectFile(AbsoluteFilePath projectFilePath) { var serializer = CreateXmlSerializer(); using var fileStream = new FileStream(projectFilePath.ToString(), FileMode.Open); XmlProject result = (XmlProject)serializer.Deserialize(fileStream); return(result); }
private static string GetPathRelativeTo(AbsoluteDirectoryPath projectDirectory, AbsoluteFilePath file) { return(file.ToString().Replace(projectDirectory.ToString() + Path.DirectorySeparatorChar, "")); }
public static CSharpFileSyntaxTree ParseFile(AbsoluteFilePath path) { return(CSharpFileSyntaxTree.ParseText(File.ReadAllText(path.ToString()), path.ToString())); }