public Task FromFile(string path)
 {
     return(dialogService.Interaction("", fileSystemOperations.ReadAllText(path), new List <Option>()
     {
         new Option("OK", OptionValue.OK)
     }, Path.GetDirectoryName(path)));
 }
Exemple #2
0
        public string Process(string path)
        {
            var directoryName = Path.GetDirectoryName(path) ?? throw new InvalidOperationException();

            var newDir = Path.Combine(fileSystemOperations.WorkingDirectory, directoryName);
            var file   = Path.GetFileName(path);

            using (new DirectorySwitch(fileSystemOperations, newDir))
            {
                var result = from line in fileSystemOperations.ReadAllText(file).Lines()
                             where !IsComment(line)
                             let processed = ExpandIfNeeded(line)
                                             select processed;

                return(string.Join(Environment.NewLine, result));
            }
        }