Пример #1
0
 private static ColoredText[] parseText(string text, string markup, Color def)
 {
     if (markup == "none")
     {
         return new ColoredText[] { new ColoredText(def, text) }
     }
     ;
     ColoredText[] output = new ColoredText[0];
     return(output);
 }
Пример #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            g.FillRectangle(barBack, ClientRectangle);

            #region Workspaces
            float LeftMost = 0;
            for (int i = 0; i < workspaces.Length; i++)
            {
                SizeF size = g.MeasureString(workspaces[i], Font);
                g.FillRectangle(i == selectedWorkspace ? wsBackF : wsBackN,
                                LeftMost, 0, size.Width + 4, barHeight);
                g.DrawString(workspaces[i], Font,
                             i == selectedWorkspace ? wsForeF : wsForeN,
                             new PointF(LeftMost + 2, 1));
                LeftMost += size.Width + 5;
            }
            #endregion

            #region Blocks
            float RightMost = ClientRectangle.Width;
            for (int i = blocks.Length - 1; i >= 0; i--)
            {
                Block block = blocks[i];
                for (int j = block.Content.Length - 1; j >= 0; j--)
                {
                    ColoredText content = block.Content[j];
                    SizeF       size    = g.MeasureString(content.Text, Font);
                    g.DrawString(content.Text, Font, content.Brush, new PointF(RightMost - size.Width, 1));
                    RightMost -= size.Width;
                }
                if (i != 0)
                {
                    g.DrawLine(separatorPen, RightMost - block.SepWidth / 2, 0, RightMost - block.SepWidth / 2, Height);
                    RightMost -= block.SepWidth;
                }
            }
            #endregion
        }