Exemple #1
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;
            var picture = new Picture();
            var ui      = new DrawableGUI(picture);
            var app     = new ConsoleUI.Application();

            app.AddCommand(new ExitCommand(app));
            app.AddCommand(new ExplainCommand(app));
            app.AddCommand(new HelpCommand(app));
            app.AddCommand(new PointCommand(picture));
            app.AddCommand(new LineCommand(picture));
            app.AddCommand(new SaveCommand(ui.GetForm()));
            app.AddCommand(new LoadCommand(picture));
            app.AddCommand(new RemoveCommand(picture));
            app.AddCommand(new ListCommand(picture));
            app.AddCommand(new EllipseCommand(picture));
            app.AddCommand(new CircleCommand(picture));
            app.AddCommand(new ColorCommand(picture));
            app.AddCommand(new WidthCommand(picture));

            picture.Changed += ui.Refresh;
            ui.Start();
            app.Run(Console.In);
            ui.Stop();
        }
Exemple #2
0
        private static void Main(string[] args)
        {
            var picture = new Picture();
            var ui      = new DrawableGUI(picture);
            var app     = new Application();

            app.AddCommand(new ExitCommand(app));
            app.AddCommand(new ExplainCommand(app));
            app.AddCommand(new HelpCommand(app));

            app.AddCommand(new PointCommand(picture));
            app.AddCommand(new LineCommand(picture));
            app.AddCommand(new EllipseCommand(picture));
            app.AddCommand(new CircleCommand(picture));

            app.AddCommand(new ListCommand(picture));
            app.AddCommand(new RemoveCommand(picture));
            app.AddCommand(new ColorCommand(picture));
            app.AddCommand(new WidthCommand(picture));

            picture.Changed += ui.Refresh;
            ui.Start();
            app.Run(Console.In);
            ui.Stop();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            var picture = new Picture();
            var ui      = new DrawableGUI(picture);
            var app     = new Application();

            app.AddCommand(new ExitCommand(app));
            app.AddCommand(new ExplainCommand(app));
            app.AddCommand(new HelpCommand(app));

            picture.Changed += ui.Refresh;
            ui.Start();
            app.Run();
            ui.Stop();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            var picture = new Picture();
            var ui      = new DrawableGUI(picture);
            var app     = new Application();

            app.AddCommand(new ExitCommand(app));
            app.AddCommand(new ExplainCommand(app));
            app.AddCommand(new HelpCommand(app));
            app.AddCommand(new DrawPointCommand(picture));
            app.AddCommand(new DrawLineCommand(picture));
            app.AddCommand(new DrawEllipseCommand(picture));
            app.AddCommand(new DrawCircleCommand(picture));
            app.AddCommand(new ListCommand(picture));
            app.AddCommand(new RemoveCommand(picture));
            app.AddCommand(new RotateCommand(picture));
            app.AddCommand(new ScaleCommand(picture));
            app.AddCommand(new TranslateCommand(picture));
            app.AddCommand(new GroupCommand(picture));
            app.AddCommand(new UngroupCommand(picture));
            app.AddCommand(new SelectionListCommand());
            app.AddCommand(new SelectCommand(picture));
            app.AddCommand(new SelectionAddCommand(picture));
            app.AddCommand(new SelectionRemoveCommand(picture));
            app.AddCommand(new UndoCommand(picture));
            app.AddCommand(new RedoCommand(picture));
            app.AddCommand(new SaveCommand(picture));
            app.AddCommand(new LoadCommand(app, picture));
            app.AddCommand(new ExportCommand(picture, new SvgExporter()));

            CommandHistoryContainer.Init(picture);

            picture.Changed += ui.Refresh;
            ui.Start();
            app.Run(Console.In);
            ui.Stop();
        }
        public static void Main(string[] args)
        {
            var picture = new Picture();
            var ui      = new DrawableGUI(picture);
            var app     = new Application();

            app.AddCommand(new ExitCommand(app));
            app.AddCommand(new ExplainCommand(app));
            app.AddCommand(new HelpCommand(app));

            // Shapes
            app.AddCommand(new PointCommand(picture));

            // Other
            app.AddCommand(new ListCommand(picture));
            app.AddCommand(new RemoveCommand(picture));
            app.AddCommand(new GroupCommand(picture));
            app.AddCommand(new UngroupCommand(picture));

            picture.Changed += ui.Refresh;
            ui.Start();
            app.Run(Console.In);
            ui.Stop();
        }