Source/BubbleButtonLayoutManager.cs

(完整代码) 1KB

using System;
using System.Drawing;
using DevComponents.UI.ContentManager;

namespace DevComponents.DotNetBar
{
	/// <summary>
	/// Represents class for default layout of the BubbleButton objects.
	/// </summary>
	public class BubbleButtonLayoutManager:BlockLayoutManager
	{
		/// <summary>
		/// Creates new instance of the class.
		/// </summary>
		public BubbleButtonLayoutManager()
		{
		}

		/// <summary>
		/// Resizes the content block and sets it's Bounds property to reflect new size.
		/// </summary>
		/// <param name="block">Content block to resize.</param>
        public override void Layout(IBlock block, Size availableSize)
		{
			BubbleButton button=block as BubbleButton;
			BubbleBar bar=button.GetBubbleBar();
			if(bar==null)
			{
				if(button.Site!=null && button.Site.DesignMode)
					return;
				throw new InvalidOperationException("BubbleBar object could not be found for button named: '"+button.Name+"' in BubbleButtonLayoutManager.Layout");
			}
			Size defaultSize=bar.ImageSizeNormal;
			button.SetDisplayRectangle(new Rectangle(button.DisplayRectangle.Location,defaultSize));
		}
	}
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。