Exemplo n.º 1
0
        private void ShowPhaseDialog(List <Zulrah.Phase> phases)
        {
            var possiblePhaseDisplay = new TableLayoutPanel {
                Anchor      = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top,
                Name        = "PossiblePhaseDisplay",
                Margin      = new Padding(0, 10, 0, 0),
                RowCount    = 1,
                RowStyles   = { new RowStyle(SizeType.AutoSize) },
                ColumnCount = phases.Count
            };

            foreach (var phase in phases)
            {
                var phaseCanvas = new CustomPanel();

                var phaseMap = new MapRenderEngine(ref phaseCanvas);

                phaseMap.ShowPhase(phase);

                possiblePhaseDisplay.ColumnStyles.Add(new ColumnStyle {
                    SizeType = SizeType.Percent,
                    Width    = Convert.ToSingle(1.0 / phases.Count)
                });

                possiblePhaseDisplay.Controls.Add(phaseCanvas, phases.IndexOf(phase), 0);
            }

            MainLayout.RowCount++;
            MainLayout.RowStyles.Insert(0, new RowStyle {
                SizeType = SizeType.Percent,
                Height   = 30
            });

            MainLayout.Controls.Add(possiblePhaseDisplay, 0, 0);
        }
Exemplo n.º 2
0
        public MapRenderEngine(ref CustomPanel canvas)
        {
            _mapCanvas = canvas;

            var mapResource = new XmlDocument();

            mapResource.LoadXml(Resources.ZulrahMap);

            _map = SvgDocument.Open(mapResource);

            _map.Height = _mapCanvas.Height;
            _map.Width  = _mapCanvas.Width;
            _flipMap    = Settings.Default.MapFlipped;

            var island = _map.GetElementById("ZulrahIsland");

            island.Fill   = new SvgColourServer(Settings.Default.ZulrahIsland_Color);
            island.Stroke = new SvgColourServer(Settings.Default.ZulrahIsland_BorderColor);

            _mapCanvas.BackColor = MapColor;

            _mapCanvas.SizeChanged += Canvas_SizeChanged;
        }