コード例 #1
0
ファイル: Program.cs プロジェクト: jeremybytes/vslive-di-lab
        private static void CreateAndShowMaze(MazeGenerator generator)
        {
            generator.GenerateMaze();

            var textMaze = generator.GetTextMaze(true);

            Console.WriteLine(textMaze);

            var graphicMaze = generator.GetGraphicalMaze(true);

            graphicMaze.Save("maze.png");
            Process p = new Process();

            p.StartInfo.FileName = "maze.png";
            p.Start();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: elmargb/di-dotnet-workshop
        private static void CreateAndShowMaze(MazeGenerator generator)
        {
            generator.GenerateMaze();

            var textMaze = generator.GetTextMaze(true);

            Console.WriteLine(textMaze);

            var graphicMaze = generator.GetGraphicalMaze(true);

            graphicMaze.Save("maze.png");

            // This code is Windows-only
            // Comment out the following if building on macOS or Linux
            // The "maze.png" file can be located in the output
            // folder: [solutionlocation]/DrawMaze/bin/Debug/netcore3.1/
            Process p = new Process();

            p.StartInfo.UseShellExecute = true;
            p.StartInfo.FileName        = "maze.png";
            p.Start();
        }