Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var fileStrategy = new FileStrategy();
            var rootDirectory = new Directory(Directory.Root, args.First(), fileStrategy);

            foreach (var file in rootDirectory.AllFiles())
            {
                var stream = new CharacterStream(file.Source());

                var include = new Include();
                var includes = include.Get(stream);
                System.Console.WriteLine(string.Join(",",includes));

                var define = new Define();
                System.Console.WriteLine(define.Get(stream.Reset()));

                var typeAlias = new TypeAlias();
                System.Console.WriteLine(typeAlias.Get(stream.Reset()));

                var comment = new Comment();
                System.Console.WriteLine(comment.Get(stream.Reset()));

                var given = new Given();
                System.Console.WriteLine(given.Get(stream.Reset()));

                var when = new When();
                System.Console.WriteLine(when.Get(stream.Reset()));
            }
        }
Exemplo n.º 2
0
 public Directory(Directory parent, string directoryPath, FileStrategy strategy)
 {
     Parent = parent;
     Strategy = strategy;
     Files = new List<File>();
     Directories = new List<Directory>();
     DirectoryPath = Path.GetFullPath(directoryPath);
     DirectoryName = DirectoryPath.Split(Constants.PathSeparator).Last();
     ScanDirectories();
     ScanFiles();
 }