Source/Ribbon/ItemBlockLayoutManager.cs

(完整代码) 1006B

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

namespace DevComponents.DotNetBar
{
	/// <summary>
	/// Represents IBlock layout manager implementation
	/// </summary>
	public class ItemBlockLayoutManager:BlockLayoutManager
	{
		/// <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)
		{
			if(block is BaseItem)
			{
				BaseItem item=block as BaseItem;
                if (item is ItemContainer || item.IsContainer)
                {
                    item.SuspendLayout = true;
                    item.WidthInternal = availableSize.Width;
                    item.HeightInternal = availableSize.Height;
                    item.SuspendLayout = false;
                }
                item.RecalcSize();
				item.Displayed=item.Visible;
			}
		}
	}
}

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

AI 解读 AI

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

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