Source/ImageItem.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace DevComponents.DotNetBar
{
using System;
using System.Drawing;
/// <summary>
/// Adds neccessary functions to base item so it supports images properly.
/// If your item implements images you should derive from this class instead of BaseItem
/// </summary>
[System.ComponentModel.ToolboxItem(false),System.ComponentModel.DesignTimeVisible(false)]
public abstract class ImageItem:BaseItem
{
private System.Drawing.Size m_SubItemsImageSize; // Biggest Image size for the sub items, they would access this property so they know how to draw themself
private System.Drawing.Size m_ImageSize;
internal static System.Drawing.Size _InitalImageSize=new System.Drawing.Size(16,16);
/// <summary>
/// Create new instance of ImageItem.
/// </summary>
public ImageItem():this("","") {}
/// <summary>
/// Create new instance of ImageItem and assigns the item name.
/// </summary>
/// <param name="sName">Item name.</param>
public ImageItem(string sName):this(sName,"") {}
/// <summary>
/// Create new instance of ImageItem and assigns the item name and text.
/// </summary>
/// <param name="sName">Item name.</param>
/// <param name="ItemText">Item text.</param>
public ImageItem(string sName, string ItemText):base(sName, ItemText)
{
m_SubItemsImageSize=_InitalImageSize;
m_ImageSize=_InitalImageSize;
}
[System.ComponentModel.Browsable(false),System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden),System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public virtual System.Drawing.Size ImageSize
{
get
{
return m_ImageSize;
}
set
{
m_ImageSize=value;
}
}
/// <summary>
/// When parent items does recalc size for its sub-items it should query
/// image size and store biggest image size into this property.
/// </summary>
[System.ComponentModel.Browsable(false),System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden),System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public virtual System.Drawing.Size SubItemsImageSize
{
get
{
return m_SubItemsImageSize;
}
set
后面还有 128 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。