Source/BubbleContentManager.cs
(开头部分) 9KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Drawing;
using DevComponents.UI.ContentManager;
namespace DevComponents.DotNetBar
{
/// <summary>
/// Represents class that provides mangification for the BubbleMar control
/// </summary>
public class BubbleContentManager:SerialContentLayoutManager
{
#region Private Variables
private Size m_BubbleSize=Size.Empty;
private float m_Factor1=0,m_Factor2=0,m_Factor3=0,m_Factor4=0;
private int m_MouseOverIndex=-1;
private int m_MouseOverPosition=-1;
#endregion
public BubbleContentManager()
{
this.ContentAlignment=eContentAlignment.Center;
}
#region IContentLayout
/// <summary>
/// Performs layout of the content block.
/// </summary>
/// <param name="containerBounds">Container bounds to layout content blocks in.</param>
/// <param name="contentBlocks">Content blocks to layout.</param>
/// <param name="blockLayout">Block layout manager that resizes the content blocks.</param>
/// <returns>The bounds of the content blocks within the container bounds.</returns>
public override Rectangle Layout(Rectangle containerBounds,IBlock[] contentBlocks,BlockLayoutManager blockLayout)
{
if(contentBlocks.Length==0)
return Rectangle.Empty;
if(m_MouseOverIndex==-1)
{
return base.Layout(containerBounds,contentBlocks,blockLayout);
}
BubbleButton[] buttons=new BubbleButton[contentBlocks.Length];
contentBlocks.CopyTo(buttons,0);
int x=0,y=0;
if(this.ContentOrientation==eContentOrientation.Horizontal)
{
buttons[m_MouseOverIndex].SetMagnifiedDisplayRectangle(new Rectangle(m_MouseOverPosition,GetY(containerBounds,m_BubbleSize.Height),m_BubbleSize.Width,m_BubbleSize.Height));
x=m_MouseOverPosition;
}
else
{
buttons[m_MouseOverIndex].SetMagnifiedDisplayRectangle(new Rectangle(GetX(containerBounds,m_BubbleSize.Width),m_MouseOverPosition,m_BubbleSize.Width,m_BubbleSize.Height));
y=m_MouseOverPosition;
}
int growthWidth=m_BubbleSize.Width-contentBlocks[0].Bounds.Width;
int growthHeight=m_BubbleSize.Height-contentBlocks[0].Bounds.Height;
后面还有 242 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。