Source/CrumbBar/CrumbBarViewContainer.cs
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Text;
using System.Drawing;
namespace DevComponents.DotNetBar
{
/// <summary>
/// Represents internal CrumbBar view container.
/// </summary>
internal class CrumbBarViewContainer : ImageItem
{
#region Internal Implementation
/// <summary>
/// Initializes a new instance of the CrumbBarViewContainer class.
/// </summary>
public CrumbBarViewContainer()
: base()
{
LabelItem imageLabel = new LabelItem("sys_crumbbarimagelabel");
this.SubItems.Add(imageLabel);
CrumbBarOverflowButton overflowButton = new CrumbBarOverflowButton("sys_crumbbaroverflowbutton");
this.SubItems.Add(overflowButton);
m_IsContainer = true;
}
/// <summary>
/// Recalculates the size of the item
/// </summary>
public override void RecalcSize()
{
if (_InternalRemove) return;
Point pos = m_Rect.Location;
Size containerSize = m_Rect.Size;
_CalculatedHeight = 0;
if (m_SubItems == null)
return;
RestoreOverflowItems();
ButtonItem overflowButton = this.OverflowButton;
LabelItem imageLabel = this.ImageLabel;
// Overflow button is hidden by default
overflowButton.Visible = false;
Rectangle itemsRect = m_Rect;
// Label may be hidden if there is no image assigned to current item
if (imageLabel.Visible)
{
imageLabel.RecalcSize();
if (imageLabel.HeightInternal > _CalculatedHeight) _CalculatedHeight = imageLabel.HeightInternal;
imageLabel.HeightInternal = containerSize.Height;
itemsRect.X += imageLabel.WidthInternal;
itemsRect.Width -= imageLabel.WidthInternal;
imageLabel.Displayed = true;
}
Point itemsPos = itemsRect.Location;
后面还有 195 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。