📄 toolbaritem.cs
字号:
namespace FreeTextBoxControls.Support
{
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
[TypeConverter(typeof(ExpandableObjectConverter))]
public abstract class ToolbarItem : IStateManager
{
protected ToolbarItem()
{
}
internal void SetDirty()
{
if (this.g_viewState != null)
{
ICollection collection1 = this.g_viewState.Keys;
foreach (string text1 in collection1)
{
this.g_viewState.SetItemDirty(text1, true);
}
}
}
internal void SetTitleLanguage(string title)
{
this.ViewState["Title"] = title;
if (this.ClientID == "")
{
this.ClientID = title.Replace(" ", "");
}
}
void IStateManager.LoadViewState(object savedState)
{
if (savedState != null)
{
((IStateManager) this.g_viewState).LoadViewState(savedState);
}
}
object IStateManager.SaveViewState()
{
if (this.g_viewState != null)
{
return ((IStateManager) this.g_viewState).SaveViewState();
}
return null;
}
void IStateManager.TrackViewState()
{
this.g_isTrackingViewState = true;
if (this.g_viewState != null)
{
((IStateManager) this.g_viewState).TrackViewState();
}
}
internal string builtInEnabledScript
{
get
{
return ((this.ViewState["builtInEnabledScript"] == null) ? string.Empty : ((string) this.ViewState["builtInEnabledScript"]));
}
set
{
this.ViewState["builtInEnabledScript"] = value;
}
}
[Browsable(false)]
public string BuiltInEnabledScript
{
get
{
return this.builtInEnabledScript;
}
}
internal string builtInScript
{
get
{
return ((this.ViewState["builtInScript"] == null) ? string.Empty : ((string) this.ViewState["builtInScript"]));
}
set
{
this.ViewState["builtInScript"] = value;
}
}
[Browsable(false)]
public string BuiltInScript
{
get
{
return this.builtInScript;
}
}
internal string builtInStateScript
{
get
{
return ((this.ViewState["builtInStateScript"] == null) ? string.Empty : ((string) this.ViewState["builtInStateScript"]));
}
set
{
this.ViewState["builtInStateScript"] = value;
}
}
[Browsable(false)]
public string BuiltInStateScript
{
get
{
return this.builtInStateScript;
}
}
internal string className
{
get
{
return ((this.ViewState["className"] == null) ? string.Empty : ((string) this.ViewState["className"]));
}
set
{
this.ViewState["className"] = value;
}
}
internal string ClientID
{
get
{
return ((this.ViewState["ClientID"] == null) ? string.Empty : ((string) this.ViewState["ClientID"]));
}
set
{
this.ViewState["ClientID"] = value;
}
}
[Description("The command identifier used for dynamic updating through the queryCommandState method"), DefaultValue(""), Category("Behavior"), NotifyParentProperty(true)]
public string CommandIdentifier
{
get
{
return ((this.ViewState["CommandIdentifier"] == null) ? string.Empty : ((string) this.ViewState["CommandIdentifier"]));
}
set
{
this.ViewState["CommandIdentifier"] = value;
}
}
[Description("The JavaScript code to determine if the button or list is enabled"), DefaultValue(""), Category("Behavior"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty), TypeConverter(typeof(string))]
public string EnabledScriptBlock
{
get
{
return ((this.ViewState["EnabledScriptBlock"] == null) ? string.Empty : ((string) this.ViewState["EnabledScriptBlock"]));
}
set
{
this.ViewState["EnabledScriptBlock"] = value;
}
}
public string FunctionName
{
get
{
return this.functionName;
}
set
{
this.functionName = value;
}
}
internal string ID
{
get
{
return this.Title.Replace(" ", "");
}
}
internal bool isBuiltIn
{
get
{
return ((this.ViewState["isBuiltIn"] != null) && ((bool) this.ViewState["isBuiltIn"]));
}
set
{
this.ViewState["isBuiltIn"] = value;
}
}
public bool IsBuiltIn
{
get
{
return this.isBuiltIn;
}
}
internal bool isProFeature
{
get
{
return ((this.ViewState["isProFeature"] != null) && ((bool) this.ViewState["isProFeature"]));
}
set
{
this.ViewState["isProFeature"] = value;
}
}
public bool IsProFeature
{
get
{
return this.isProFeature;
}
}
[DefaultValue(""), Category("Behavior"), Description("The JavaScript code for the function"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty), TypeConverter(typeof(string))]
public string ScriptBlock
{
get
{
return ((this.ViewState["ScriptBlock"] == null) ? string.Empty : ((string) this.ViewState["ScriptBlock"]));
}
set
{
this.ViewState["ScriptBlock"] = value;
}
}
[Category("Behavior"), DefaultValue(""), Description("The JavaScript code to determine the state of the button or list"), NotifyParentProperty(true), PersistenceMode(PersistenceMode.InnerProperty), TypeConverter(typeof(string))]
public string StateScriptBlock
{
get
{
return ((this.ViewState["StateScriptBlock"] == null) ? string.Empty : ((string) this.ViewState["StateScriptBlock"]));
}
set
{
this.ViewState["StateScriptBlock"] = value;
}
}
bool IStateManager.IsTrackingViewState
{
get
{
return this.g_isTrackingViewState;
}
}
[Category("Behavior"), Description("The alt text for the ToolbarButton"), NotifyParentProperty(true)]
public string Title
{
get
{
return ((this.ViewState["Title"] == null) ? string.Empty : ((string) this.ViewState["Title"]));
}
set
{
this.ViewState["Title"] = value;
if (this.ClientID == "")
{
this.ClientID = value.Replace(" ", "");
}
this.ViewState["TitleHasBeenSet"] = true;
HttpContext.Current.Trace.Write("Title", "set: " + value);
}
}
internal bool TitleHasBeenSet
{
get
{
return ((this.ViewState["TitleHasBeenSet"] != null) && ((bool) this.ViewState["TitleHasBeenSet"]));
}
}
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
protected StateBag ViewState
{
get
{
if (this.g_viewState == null)
{
this.g_viewState = new StateBag(false);
if (this.g_isTrackingViewState)
{
((IStateManager) this.g_viewState).TrackViewState();
}
}
return this.g_viewState;
}
}
private string functionName;
protected bool g_isTrackingViewState;
protected StateBag g_viewState;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -