Esempio n. 1
0
        public static void Main()
        {
            Rectangle     rec = new Rectangle();
            GraphicEditor gr  = new GraphicEditor();

            gr.DrawShape(rec);
        }
Esempio n. 2
0
        public static void Main()
        {
            IShape        sq = new Square();
            GraphicEditor gr = new GraphicEditor();

            gr.DrawShape(sq);
        }
Esempio n. 3
0
        public static void Main()
        {
            Cube          cube   = new Cube();
            GraphicEditor editor = new GraphicEditor();

            editor.DrawShape(cube);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            IShape        shape = new Rectangle();
            GraphicEditor ge    = new GraphicEditor();

            ge.DrawShape(shape);
        }
Esempio n. 5
0
        public static void Main()
        {
            IShape        rectangle = new Rectangle();
            GraphicEditor grEditor  = new GraphicEditor();

            grEditor.DrawShape(rectangle);
        }
Esempio n. 6
0
        public MainWindowVM()
        {
            CurrentSign = new PLSign();

            EffectCommand = new RelayCommand <SignEffect>(s =>
            {
                int oldIndex = Window.MessageBoxCaretIndex;
                MessageText  = MessageText.Insert(oldIndex, s.Text);
                Window.MessageBoxCaretIndex = oldIndex + s.Text.Length;
            });

            SendMessageCommand = new RelayCommand(() =>
            {
                if (!string.IsNullOrEmpty(msg))
                {
                    CurrentSign.SendMessage(msg, SelectedPage);
                }
            });

            NewGraphicCommand = new RelayCommand(() =>
            {
                graphicsWindow     = new GraphicEditor();
                GraphicEditorVM vm = graphicsWindow.DataContext as GraphicEditorVM;
                vm.CurrentSign     = CurrentSign;
                vm.MainWindow      = this;
                graphicsWindow.Show();
            });

            RefreshComPortsCommand = new RelayCommand(() =>
            {
                OpenComPorts = SerialSign.OpenComPorts();
                RaisePropertyChanged("");
            });
        }
Esempio n. 7
0
        public static void Main()
        {
            IShape        circle = new Circle();
            GraphicEditor editor = new GraphicEditor();

            editor.DrawShape(circle);
        }
Esempio n. 8
0
 private void ReloadGraphicEditor()
 {
     if (GraphicEditor != null)
     {
         GraphicEditor.Reload(Tileset.Graphics, Tileset.Graphics.Length, 0, PaletteSet, 0, 0x20);
     }
 }
Esempio n. 9
0
        static GraphicEditor ReadFromFile(string filename)
        {
            try
            {
                var serializer = new JsonSerializer
                {
                    NullValueHandling = NullValueHandling.Include,
                    TypeNameHandling  = TypeNameHandling.All,
                    Formatting        = Formatting.Indented
                };

                List <Figure> tmp;

                using (var sr = new JsonTextReader(new StreamReader(filename)))
                {
                    tmp = serializer.Deserialize <List <Figure> >(sr);
                }

                var editor = new GraphicEditor();
                editor.AddFigures(tmp);
                return(editor);
            }
            catch (Exception)
            {
                throw new Exception("Неверный формат файла");
            }
        }
Esempio n. 10
0
 private void openGraphics_Click(object sender, EventArgs e)
 {
     if (GraphicEditor == null)
     {
         LoadGraphicEditor();
     }
     GraphicEditor.Show();
 }
Esempio n. 11
0
        public static void Main(string[] args)
        {
            IShape rectangle = new Rectangle();

            GraphicEditor myGraphEditor = new GraphicEditor();

            myGraphEditor.DrawShape(rectangle);
        }
Esempio n. 12
0
        static void Main(string[] args)
        {
            GraphicEditor graphicEditor = new GraphicEditor();

            graphicEditor.DrawShape(new Circle());
            graphicEditor.DrawShape(new Square());
            graphicEditor.DrawShape(new Rectangle());
        }
Esempio n. 13
0
        static void Main()
        {
            IShape circle    = new Circle();
            IShape square    = new Square();
            IShape rexctanle = new Rectangle();

            var graphEditor = new GraphicEditor(square);

            graphEditor.DrawShape();
        }
        public static void Main()
        {
            var circle = new Circle();
            var square = new Square();

            var editor = new GraphicEditor();

            editor.DrawShape(circle);
            editor.DrawShape(square);
        }
Esempio n. 15
0
 public void LoadGraphicEditor()
 {
     if (graphicEditor == null)
     {
         graphicEditor       = new GraphicEditor(new GraphicUpdater(), graphics, graphics.Length, 0, PaletteSet, 1, 0x20);
         graphicEditor.Owner = this;
     }
     else
     {
         ReloadGraphicEditor();
     }
 }
Esempio n. 16
0
        static void Main()
        {
            var circle    = new Circle();
            var rectangle = new Rectangle();
            var square    = new Square();

            var graphicEditor = new GraphicEditor();

            graphicEditor.DrawShape(circle);
            graphicEditor.DrawShape(rectangle);
            graphicEditor.DrawShape(square);
        }
Esempio n. 17
0
        public static void Main()
        {
            IShape circle    = new Circle();
            IShape square    = new Square();
            IShape rectangle = new Rectangle();

            GraphicEditor editor = new GraphicEditor();

            editor.DrawShape(circle);
            editor.DrawShape(square);
            editor.DrawShape(rectangle);
        }
Esempio n. 18
0
        private static void Main()
        {
            GraphicEditor graphicEditor = new GraphicEditor();

            Circle    circle    = new Circle("Circle");
            Rectangle rectangle = new Rectangle("Rectangle");
            Square    square    = new Square("Square");

            graphicEditor.DrawShape(circle);
            graphicEditor.DrawShape(rectangle);
            graphicEditor.DrawShape(square);
        }
Esempio n. 19
0
 private void LoadLogoGraphicEditor()
 {
     if (logoGraphicEditor == null)
     {
         logoGraphicEditor       = new GraphicEditor(new LogoGraphicUpdater(), Model.Logos_Graphics, Model.Logos_Graphics.Length, 0, Model.Logos_PaletteSet, 0, 0x20);
         logoGraphicEditor.Owner = this;
     }
     else
     {
         logoGraphicEditor.Reload(Model.Logos_Graphics, Model.Logos_Graphics.Length, 0, Model.Logos_PaletteSet, 0, 0x20);
     }
 }
Esempio n. 20
0
 private void LoadGraphicEditor()
 {
     if (graphicEditor == null)
     {
         graphicEditor = new GraphicEditor(new GraphicUpdater(),
                                           tileset.Graphics, tileset.Graphics.Length, 0, paletteSets[palette], 1, 0x20);
         graphicEditor.FormClosing += new FormClosingEventHandler(editor_FormClosing);
     }
     else
     {
         graphicEditor.Reload(tileset.Graphics, tileset.Graphics.Length, 0, paletteSets[palette], 1, 0x20);
     }
 }
Esempio n. 21
0
 private void LoadMenuGraphicEditor()
 {
     if (menuGraphicEditor == null)
     {
         menuGraphicEditor = new GraphicEditor(new GraphicMenuUpdater(),
                                               Model.Graphics_BattleMenu, Model.Graphics_BattleMenu.Length, 0, Model.Palette_BattleMenu, 0, 0x20);
         menuGraphicEditor.Owner = this;
     }
     else
     {
         ReloadMenuGraphicEditor();
     }
 }
Esempio n. 22
0
 private void LoadSpriteGraphicEditor()
 {
     if (spriteGraphicEditor == null)
     {
         spriteGraphicEditor = new GraphicEditor(new GraphicSpritesUpdater(),
                                                 Model.ObjectGraphics, Model.ObjectGraphics.Length, 0, Model.ObjectPaletteSet, 0, 0x20);
         spriteGraphicEditor.Owner = this;
     }
     else
     {
         ReloadSpriteGraphicEditor();
     }
 }
Esempio n. 23
0
 // Loading
 private void LoadNumeralGraphicEditor()
 {
     if (numeralGraphicEditor == null)
     {
         numeralGraphicEditor = new GraphicEditor(new GraphicUpdater(),
                                                  Model.Graphics_Numerals, Model.Graphics_Numerals.Length, 0, Model.Palette_Numerals, 0, 0x20);
         numeralGraphicEditor.Owner = this;
     }
     else
     {
         ReloadNumeralGraphicEditor();
     }
 }
Esempio n. 24
0
 private void LoadGraphicEditor()
 {
     if (GraphicEditor == null)
     {
         GraphicEditor = new GraphicEditor(new GraphicUpdater(),
                                           Tileset.Graphics, Tileset.Graphics.Length, 0, PaletteSet, 0, 0x20);
         GraphicEditor.Owner = this;
     }
     else
     {
         ReloadGraphicEditor();
     }
 }
Esempio n. 25
0
 private void LoadGraphicEditor()
 {
     if (graphicEditor == null)
     {
         graphicEditor = new GraphicEditor(new GraphicPreGameUpdater(), castGraphics,
                                           castGraphics.Length, 0, paletteSet, 0, 0x10);
         graphicEditor.FormClosing += new FormClosingEventHandler(editor_FormClosing);
         graphicEditor.Owner        = this.Owner;
     }
     else
     {
         graphicEditor.Reload(castGraphics, castGraphics.Length, 0, paletteSet, 0, 0x10);
     }
 }
Esempio n. 26
0
 private void LoadSpriteGraphicEditor()
 {
     if (spriteGraphicEditor == null)
     {
         spriteGraphicEditor = new GraphicEditor(new GraphicSpriteUpdater(),
                                                 Model.Title_SpriteGraphics, Model.Title_SpriteGraphics.Length, 0, spritePaletteSet, 0, 0x20);
         spriteGraphicEditor.FormClosing += new FormClosingEventHandler(editor_FormClosing);
         spriteGraphicEditor.Owner        = this;
     }
     else
     {
         spriteGraphicEditor.Reload(Model.Title_SpriteGraphics, Model.Title_SpriteGraphics.Length, 0, spritePaletteSet, 0, 0x20);
     }
 }
Esempio n. 27
0
 private void LoadMenuGraphicEditor()
 {
     if (menuGraphicEditor == null)
     {
         menuGraphicEditor = new GraphicEditor(new Function(MenuGraphicUpdate),
                                               Model.BattleMenuGraphics, Model.BattleMenuGraphics.Length, 0, Model.BattleMenuPalette, 0, 0x20);
         menuGraphicEditor.FormClosing += new FormClosingEventHandler(editor_FormClosing);
     }
     else
     {
         menuGraphicEditor.Reload(new Function(MenuGraphicUpdate),
                                  Model.BattleMenuGraphics, Model.BattleMenuGraphics.Length, 0, Model.BattleMenuPalette, 0, 0x20);
     }
 }
Esempio n. 28
0
 //
 private void LoadGraphicEditor()
 {
     if (numeralGraphicEditor == null)
     {
         numeralGraphicEditor = new GraphicEditor(new Function(GraphicUpdate),
                                                  Model.NumeralGraphics, Model.NumeralGraphics.Length, 0, Model.NumeralPaletteSet, 0, 0x20);
         numeralGraphicEditor.FormClosing += new FormClosingEventHandler(editor_FormClosing);
     }
     else
     {
         numeralGraphicEditor.Reload(new Function(GraphicUpdate),
                                     Model.NumeralGraphics, Model.NumeralGraphics.Length, 0, Model.NumeralPaletteSet, 0, 0x20);
     }
 }
Esempio n. 29
0
        static void WriteInFile(string filename, GraphicEditor editor)
        {
            var serializer = new JsonSerializer
            {
                NullValueHandling = NullValueHandling.Include,
                TypeNameHandling  = TypeNameHandling.All,
                Formatting        = Formatting.Indented
            };

            using (StreamWriter sw = new StreamWriter(filename))
            {
                serializer.Serialize(sw, editor.Figures);
            }
        }
Esempio n. 30
0
 public void LoadGraphicEditor()
 {
     if (graphicEditor == null)
     {
         graphicEditor = new GraphicEditor(new Function(GraphicUpdate),
                                           graphics, graphics.Length, 0, paletteSet, 0, 0x20, 1);
         graphicEditor.FormClosing += new FormClosingEventHandler(editor_FormClosing);
     }
     else
     {
         graphicEditor.Reload(new Function(GraphicUpdate),
                              graphics, graphics.Length, 0, paletteSet, 0, 0x20, 1);
     }
 }