Exemple #1
0
        /// <summary>Paint on the graphics context</summary>
        /// <param name="context">The graphics context to draw on</param>
        public override void Paint(IDrawContext context)
        {
            Color outlineColour;

            if (Selected)
            {
                outlineColour = Color.Blue;
            }
            else if (transparent)
            {
                outlineColour = DefaultBackgroundColour;
            }
            else
            {
                outlineColour = DefaultOutlineColour;
            }

            Color backgroundColour = transparent ? DefaultBackgroundColour : Colour;
            Color textColour       = DefaultOutlineColour;

            // Draw circle
            context.SetColour(outlineColour);
            context.SetLineWidth(3);
            context.NewPath();
            context.Arc(Location.X, Location.Y, Width / 2, 0, 2 * Math.PI);
            context.StrokePreserve();
            context.SetColour(backgroundColour);
            context.Fill();

            // Write text
            context.SetLineWidth(1);
            context.SetColour(textColour);
            context.SetFontSize(13);


            DrawCentredText(context, Name, Location);
        }