Пример #1
0
        public override void Render(RenderArgs args)
        {
            var prot    = args.Prototype;
            var context = args.Context;
            var bounds  = args.Bounds;
            var x2      = prot.Parameter.ContainsKey("X2") ? (ScreenPos)prot.Parameter["X2"].Value : new ScreenPos();
            var y2      = prot.Parameter.ContainsKey("Y2") ? (ScreenPos)prot.Parameter["Y2"].Value : new ScreenPos();
            var fg      = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value);

            if (fg != null)
            {
                context.DrawLine(bounds.TopLeft, new Vector2(args.Transform(x2, false), args.Transform(y2, true)), fg);
            }
        }
Пример #2
0
        public override void Render(RenderArgs args)
        {
            var prot    = args.Prototype;
            var context = args.Context;
            var bounds  = args.Bounds;
            var text    = prot.Parameter["Text"].Value as String;
            var align   = prot.Parameter.ContainsKey("Align") ? (Align)prot.Parameter["Align"].Value : Align.Left;
            var valign  = prot.Parameter.ContainsKey("Valign") ? (Valign)prot.Parameter["Valign"].Value : Valign.Top;
            var size    = prot.Parameter.ContainsKey("FontSize") ? (ScreenPos)prot.Parameter["FontSize"].Value : new ScreenPos();
            var fg      = Ressources.GetBrush((Color)prot.Parameter["ForeColor"].Value);
            //var bg = Ressources.GetBrush((string)prot.Parameter["BackColor"].Value);
            var format = Ressources.GetFormat(args.Transform(size, true), align, valign);

            if (fg != null && text != null)
            {
                context.DrawText(text, format, bounds, fg);
            }
        }