📄 basemenu.cs
字号:
using System;
using System.Web.UI;
using System.Collections;
using System.ComponentModel;
using System.Web.UI.WebControls;
namespace ComponentArt.Web.UI
{
/// <summary>
/// Provides ItemLook handling services to all of its descendents. All menu-based ComponentArt navigation controls inherit from this class.
/// </summary>
public abstract class BaseMenu : BaseNavigator
{
#region Properties
#region Unused hidden inheritance
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override System.Drawing.Color BackColor
{
get { return base.BackColor; }
}
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override System.Drawing.Color ForeColor
{
get { return base.ForeColor; }
}
#endregion
internal BaseMenuItem m_oForceHighlightedItem = null;
/// <summary>
/// Constructor
/// </summary>
public BaseMenu() : base()
{
// Set some defaults.
this.CollapseDuration = 200;
this.CollapseSlide = SlideType.ExponentialDecelerate;
this.ExpandDuration = 200;
this.ExpandSlide = SlideType.ExponentialDecelerate;
}
/// <summary>
/// The duration of the collapse animation, in milliseconds.
/// </summary>
/// <seealso cref="CollapseSlide" />
/// <seealso cref="CollapseTransition" />
/// <seealso cref="CollapseTransitionCustomFilter" />
[Category("Animation")]
[Description("The duration of the collapse animation, in milliseconds.")]
[DefaultValue(200)]
public int CollapseDuration
{
get
{
return Utils.ParseInt(ViewState["CollapseDuration"]);
}
set
{
ViewState["CollapseDuration"] = value;
}
}
/// <summary>
/// The slide type to use for the collapse animation.
/// </summary>
/// <seealso cref="CollapseDuration" />
/// <seealso cref="CollapseTransition" />
/// <seealso cref="CollapseTransitionCustomFilter" />
[Category("Animation")]
[Description("The slide type to use for the collapse animation.")]
[DefaultValue(SlideType.ExponentialDecelerate)]
public SlideType CollapseSlide
{
get
{
return Utils.ParseSlideType(ViewState["CollapseSlide"]);
}
set
{
ViewState["CollapseSlide"] = value;
}
}
/// <summary>
/// The transition effect to use for the collapse animation.
/// </summary>
/// <seealso cref="CollapseDuration" />
/// <seealso cref="CollapseSlide" />
/// <seealso cref="CollapseTransitionCustomFilter" />
[Category("Animation")]
[Description("The transition effect to use for the collapse animation.")]
[DefaultValue(TransitionType.None)]
public TransitionType CollapseTransition
{
get
{
return Utils.ParseTransitionType(ViewState["CollapseTransition"]);
}
set
{
ViewState["CollapseTransition"] = value;
}
}
/// <summary>
/// The custom transition filter to use for the collapse animation.
/// </summary>
/// <seealso cref="CollapseDuration" />
/// <seealso cref="CollapseSlide" />
/// <seealso cref="CollapseTransition" />
[Category("Animation")]
[Description("The custom transition filter to use for the collapse animation.")]
[DefaultValue(null)]
public string CollapseTransitionCustomFilter
{
get
{
return (string)ViewState["CollapseTransitionCustomFilter"];
}
set
{
ViewState["CollapseTransitionCustomFilter"] = value;
}
}
private ItemLook _defaultChildSelectedItemLook;
/// <summary>
/// The default look to apply to ancestors of the selected item.
/// </summary>
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ItemLook DefaultChildSelectedItemLook
{
get
{
if(_defaultChildSelectedItemLook == null)
{
_defaultChildSelectedItemLook = new ItemLook(false, true);
}
return _defaultChildSelectedItemLook;
}
set
{
if(value != null)
{
_defaultChildSelectedItemLook = (ItemLook)value.Clone();
}
}
}
/// <summary>
/// The ID of the default look to apply to ancestors of the selected item.
/// </summary>
[Description("The ID of the default look to apply to ancestors of the selected item.")]
[DefaultValue("")]
[Category("ItemLook")]
public string DefaultChildSelectedItemLookId
{
get
{
object o = ViewState["DefaultChildSelectedItemLookId"];
return (o == null) ? string.Empty : (string)o;
}
set
{
ViewState["DefaultChildSelectedItemLookId"] = value;
}
}
private ItemLook _defaultDisabledItemLook;
/// <summary>
/// The default look to apply to disabled items.
/// </summary>
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ItemLook DefaultDisabledItemLook
{
get
{
if(_defaultDisabledItemLook == null)
{
_defaultDisabledItemLook = new ItemLook(false, true);
}
return _defaultDisabledItemLook;
}
set
{
if(value != null)
{
_defaultDisabledItemLook = (ItemLook)value.Clone();
}
}
}
/// <summary>
/// The ID of the default look to apply to disabled items.
/// </summary>
[Description("The ID of the default look to apply to disabled items.")]
[DefaultValue("")]
[Category("ItemLook")]
public string DefaultDisabledItemLookId
{
get
{
object o = ViewState["DefaultDisabledItemLookId"];
return (o == null) ? string.Empty : (string)o;
}
set
{
ViewState["DefaultDisabledItemLookId"] = value;
}
}
/// <summary>
/// The default CSS class to apply to groups
/// </summary>
[Description("The default CSS class to apply to groups")]
[DefaultValue(null)]
[Category("Appearance")]
public string DefaultGroupCssClass
{
get
{
return (string)ViewState["DefaultGroupCssClass"];
}
set
{
ViewState["DefaultGroupCssClass"] = value;
}
}
private ItemLook _defaultItemLook;
/// <summary>
/// The default look to apply to items.
/// </summary>
/// <seealso cref="BaseMenuItem.Look" />
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ItemLook DefaultItemLook
{
get
{
if(_defaultItemLook == null)
{
_defaultItemLook = new ItemLook(false, true);
}
return _defaultItemLook;
}
set
{
if(value != null)
{
_defaultItemLook = (ItemLook)value.Clone();
}
}
}
/// <summary>
/// The ID of the default look to apply to items.
/// </summary>
[Description("The ID of the default look to apply to items.")]
[DefaultValue("")]
[Category("ItemLook")]
public string DefaultItemLookId
{
get
{
object o = ViewState["DefaultItemLookId"];
return (o == null) ? string.Empty : (string)o;
}
set
{
ViewState["DefaultItemLookId"] = value;
}
}
/// <summary>
/// The default text alignment to apply to labels.
/// </summary>
/// <seealso cref="BaseMenuItem.TextAlign" />
[Category("Appearance")]
[DefaultValue(TextAlign.Left)]
[Description("The default text alignment to apply to labels.")]
public TextAlign DefaultItemTextAlign
{
get
{
return Utils.ParseTextAlign(ViewState["DefaultItemTextAlign"]);
}
set
{
ViewState["DefaultItemTextAlign"] = value;
}
}
/// <summary>
/// Whether to permit text wrapping in labels by default.
/// </summary>
/// <seealso cref="BaseMenuItem.TextWrap" />
[Category("Layout")]
[DefaultValue(false)]
[Description("Whether to permit text wrapping in labels by default.")]
public bool DefaultItemTextWrap
{
get
{
return Utils.ParseBool(ViewState["DefaultItemTextWrap"], false);
}
set
{
ViewState["DefaultItemTextWrap"] = value;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -