Source/Rendering/Office2007ProgressBarItemPainter.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace DevComponents.DotNetBar.Rendering
{
internal class Office2007ProgressBarItemPainter : ProgressBarItemPainter, IOffice2007Painter
{
#region IOffice2007Painter
private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();
/// <summary>
/// Gets or sets color table used by renderer.
/// </summary>
public Office2007ColorTable ColorTable
{
get { return m_ColorTable; }
set { m_ColorTable = value; }
}
#endregion
#region Internal Implementation
public override void Paint(ProgressBarItemRenderEventArgs e)
{
Rectangle r = e.ProgressBarItem.DisplayRectangle;
if (r.Width <= 0 || r.Height <= 0)
return;
ProgressBarItem item = e.ProgressBarItem;
Office2007ProgressBarColorTable ct = m_ColorTable.ProgressBarItem;
if(item.ColorTable == eProgressBarItemColor.Paused)
ct = m_ColorTable.ProgressBarItemPaused;
else if (item.ColorTable == eProgressBarItemColor.Error)
ct = m_ColorTable.ProgressBarItemError;
Graphics g = e.Graphics;
DisplayHelp.DrawRoundedRectangle(g, ct.OuterBorder, r, 2);
r.Inflate(-1, -1);
Brush brush = DisplayHelp.CreateBrush(r, ct.BackgroundColors);
if (brush != null)
{
g.FillRectangle(brush, r);
brush.Dispose();
}
DisplayHelp.DrawRoundedRectangle(g, ct.InnerBorder, r, 2);
r.Inflate(-1, -1);
Region oldClip = g.Clip;
try
{
g.SetClip(r, CombineMode.Intersect);
Rectangle chunkRect = r;
if (item.ProgressType == eProgressItemType.Marquee)
{
// Horizontal
if (item.Orientation == eOrientation.Horizontal)
后面还有 89 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。