private void RenderButton(MapGraphics g, PanelButton button) { float num = (float)(g.GetAbsoluteDimension(100f) - 1.0); SizeF absoluteSize = g.GetAbsoluteSize(new SizeF(100f, 100f)); absoluteSize.Width -= 1f; absoluteSize.Height -= 1f; SizeF sizeF = new SizeF((float)((absoluteSize.Width - num) / 2.0), (float)((absoluteSize.Height - num) / 2.0)); float num2 = (float)(num / 3.0); PointF pointF = PointF.Empty; switch (button.Type) { case PanelButtonType.NavigationButton: pointF = new PointF((float)(num / 2.0), (float)(num2 / 2.0)); if (!this.CenterButtonVisible) { pointF.Y += 2f; } break; case PanelButtonType.NaviagateSouth: pointF = new PointF((float)(num / 2.0), (float)(num - num2 / 2.0)); if (!this.CenterButtonVisible) { pointF.Y -= 2f; } break; case PanelButtonType.NaviagateEast: pointF = new PointF((float)(num - num2 / 2.0), (float)(num / 2.0)); if (!this.CenterButtonVisible) { pointF.X -= 2f; } break; case PanelButtonType.NaviagateWest: pointF = new PointF((float)(num2 / 2.0), (float)(num / 2.0)); if (!this.CenterButtonVisible) { pointF.X += 2f; } break; case PanelButtonType.NaviagateCenter: pointF = new PointF((float)(num / 2.0), (float)(num / 2.0)); break; default: throw new ArgumentException(SR.invalid_button_type); } num2 = (float)(num2 - 4.0); RectangleF absolute = new RectangleF((float)(sizeF.Width + pointF.X - num2 / 2.0), (float)(sizeF.Height + pointF.Y - num2 / 2.0), num2, num2); button.Bounds = g.GetRelativeRectangle(absolute); button.Render(g); }
private void RenderButton(MapGraphics g, PanelButton button) { float num = g.GetAbsoluteDimension(100f) - 1f; SizeF absoluteSize = g.GetAbsoluteSize(new SizeF(100f, 100f)); absoluteSize.Width -= 1f; absoluteSize.Height -= 1f; SizeF sizeF = new SizeF((absoluteSize.Width - num) / 2f, (absoluteSize.Height - num) / 2f); float num2 = num / 3f; PointF empty = PointF.Empty; switch (button.Type) { case PanelButtonType.NavigationButton: empty = new PointF(num / 2f, num2 / 2f); if (!CenterButtonVisible) { empty.Y += 2f; } break; case PanelButtonType.NaviagateSouth: empty = new PointF(num / 2f, num - num2 / 2f); if (!CenterButtonVisible) { empty.Y -= 2f; } break; case PanelButtonType.NaviagateEast: empty = new PointF(num - num2 / 2f, num / 2f); if (!CenterButtonVisible) { empty.X -= 2f; } break; case PanelButtonType.NaviagateWest: empty = new PointF(num2 / 2f, num / 2f); if (!CenterButtonVisible) { empty.X += 2f; } break; case PanelButtonType.NaviagateCenter: empty = new PointF(num / 2f, num / 2f); break; default: throw new ArgumentException(SR.invalid_button_type); } num2 -= 4f; RectangleF absolute = new RectangleF(sizeF.Width + empty.X - num2 / 2f, sizeF.Height + empty.Y - num2 / 2f, num2, num2); button.Bounds = g.GetRelativeRectangle(absolute); button.Render(g); }
internal void RenderPanel(MapGraphics g) { if (!IsVisible()) { return; } try { RectangleF relativeRectangle = g.GetRelativeRectangle(Margins.AdjustRectangle(GetBoundsInPixels())); g.CreateDrawRegion(relativeRectangle); SizeF absoluteSize = g.GetAbsoluteSize(new SizeF(100f, 100f)); if (absoluteSize.Width < 1f || absoluteSize.Height < 1f) { return; } if (ShouldRenderBackground() && GetMapCore().RenderingMode != RenderingMode.ZoomThumb) { RenderBackground(g); RenderBorder(g); } if (BorderWidth > 0 && ShouldRenderBackground()) { try { RectangleF absoluteRectangle = g.GetAbsoluteRectangle(new RectangleF(0f, 0f, 100f, 100f)); absoluteRectangle.Inflate(-BorderWidth, -BorderWidth); absoluteRectangle.Width = Math.Max(2f, absoluteRectangle.Width); absoluteRectangle.Height = Math.Max(2f, absoluteRectangle.Height); g.CreateDrawRegion(g.GetRelativeRectangle(absoluteRectangle)); Render(g); } finally { g.RestoreDrawRegion(); } } else { Render(g); } } finally { g.RestoreDrawRegion(); } }
public void RenderPanel(MapGraphics g) { if (this.IsVisible()) { try { RectangleF relativeRectangle = g.GetRelativeRectangle(this.Margins.AdjustRectangle(this.GetBoundsInPixels())); g.CreateDrawRegion(relativeRectangle); SizeF absoluteSize = g.GetAbsoluteSize(new SizeF(100f, 100f)); if (!(absoluteSize.Width < 1.0) && !(absoluteSize.Height < 1.0)) { if (this.ShouldRenderBackground() && this.GetMapCore().RenderingMode != RenderingMode.ZoomThumb) { this.RenderBackground(g); this.RenderBorder(g); } if (this.BorderWidth > 0 && this.ShouldRenderBackground()) { try { RectangleF absoluteRectangle = g.GetAbsoluteRectangle(new RectangleF(0f, 0f, 100f, 100f)); absoluteRectangle.Inflate((float)(-this.BorderWidth), (float)(-this.BorderWidth)); absoluteRectangle.Width = Math.Max(2f, absoluteRectangle.Width); absoluteRectangle.Height = Math.Max(2f, absoluteRectangle.Height); g.CreateDrawRegion(g.GetRelativeRectangle(absoluteRectangle)); this.Render(g); } finally { g.RestoreDrawRegion(); } } else { this.Render(g); } } } finally { g.RestoreDrawRegion(); } } }
internal override void Render(MapGraphics g) { AbsoluteSize = g.GetAbsoluteSize(Size); AdjustScaleSize(g); switch (GetMapCore().RenderingMode) { case RenderingMode.ZoomThumb: RenderDynamicElements(g); break; case RenderingMode.SinglePanel: base.Render(g); RenderStaticElements(g); break; default: base.Render(g); RenderStaticElements(g); RenderDynamicElements(g); break; } }
public override void Render(MapGraphics g) { this.AbsoluteSize = g.GetAbsoluteSize(this.Size); this.AdjustScaleSize(g); switch (base.GetMapCore().RenderingMode) { case RenderingMode.ZoomThumb: this.RenderDynamicElements(g); break; case RenderingMode.SinglePanel: base.Render(g); this.RenderStaticElements(g); break; default: base.Render(g); this.RenderStaticElements(g); this.RenderDynamicElements(g); break; } }