📄 freetextbox.cs
字号:
{
base.OnLoad(e);
}
protected override void OnPreRender(EventArgs e)
{
if (!this.DesignMode)
{
if ((this.browserInfo != null) && this.browserInfo.IsRichCapable)
{
this.resourceManager = new ResourceManager(this.Language, this.SupportFolder + "Languages/");
foreach (Toolbar toolbar1 in this.Toolbars)
{
foreach (ToolbarItem item1 in toolbar1.Items)
{
if (item1 is ToolbarDropDownList)
{
if (((ToolbarDropDownList) item1).IsBuiltIn && (((ToolbarDropDownList) item1).Items.Count == 0))
{
Helper.PopulateDefaultDropDownList((ToolbarDropDownList) item1, this, this.resourceManager);
}
}
else
{
HttpContext.Current.Trace.Write("ToolbarItems", item1.Title + ":" + item1.GetType());
}
}
}
this.SetupToolbarButtonStyles();
}
this.Page.RegisterRequiresPostBack(this);
this.Page.RegisterRequiresPostBack(this);
this.RegisterClientScript();
}
base.OnPreRender(e);
}
protected virtual void OnProcessText(EventArgs e)
{
if (this.ProcessText != null)
{
this.ProcessText(this, e);
}
}
protected virtual void OnSaveClick(EventArgs e)
{
if (this.SaveClick != null)
{
this.SaveClick(this, e);
}
}
protected virtual void OnTextChanged(EventArgs e)
{
if (this.TextChanged != null)
{
this.TextChanged(this, e);
}
}
public virtual void RaisePostBackEvent(string eventArgument)
{
HttpContext.Current.Trace.Write("PostBackEvent", eventArgument);
string text1 = eventArgument;
if ((text1 != null) && (text1 == "Save"))
{
this.OnSaveClick(EventArgs.Empty);
}
}
public void RaisePostDataChangedEvent()
{
this.OnTextChanged(EventArgs.Empty);
this.OnProcessText(EventArgs.Empty);
}
protected virtual void RegisterClientScript()
{
if ((this.RenderMode == FreeTextBoxControls.RenderMode.Rich) || ((this.RenderMode == FreeTextBoxControls.RenderMode.NotSet) && this.browserInfo.IsRichCapable))
{
string text10;
this.Page.RegisterOnSubmitStatement(this.ClientID + "_OnSubmit", "FTB_API['" + this.ClientID + "'].StoreHtml();");
if (!this.Page.IsClientScriptBlockRegistered("FTB-Scripts"))
{
string text1 = "<script type=\"text/javascript\" src=\"" + this.CreateResourceString("FTB-Utility.js", ResourceType.JavaScript) + "\"></script>\r\n<script type=\"text/javascript\" src=\"" + this.CreateResourceString("FTB-FreeTextBox.js", ResourceType.JavaScript) + "\"></script>\r\n<script type=\"text/javascript\" src=\"" + this.CreateResourceString("FTB-ToolbarItems.js", ResourceType.JavaScript) + "\"></script>";
if (this.license.IsPro)
{
text1 = text1 + "<script type=\"text/javascript\" src=\"" + this.CreateResourceString("FTB-Pro.js", ResourceType.JavaScript) + "\"></script>";
}
this.Page.RegisterClientScriptBlock("FTB-Scripts", text1);
}
if (!this.Page.IsClientScriptBlockRegistered("FreeTextBoxInfo"))
{
string text4;
IDisposable disposable1;
ArrayList list1 = new ArrayList();
string text2 = typeof(FreeTextBox).Assembly.FullName;
string text3 = text2.Substring(text2.IndexOf("=") + 1);
list1.Add("FreeTextBox v3 (" + text3.Substring(0, text3.IndexOf(",")) + ")");
list1.Add("http://www.freetextbox.com/");
list1.Add("ASP.NET HTML editor for PC/IE & Mozilla");
list1.Add("License Type: " + this.license.LicenseKey + " (To: " + this.license.Data + ")");
int num1 = 0;
IEnumerator enumerator1 = list1.GetEnumerator();
try
{
while (enumerator1.MoveNext())
{
text4 = (string) enumerator1.Current;
if (text4.Length > num1)
{
num1 = text4.Length;
}
}
}
finally
{
disposable1 = enumerator1 as IDisposable;
if (disposable1 != null)
{
disposable1.Dispose();
}
}
num1 += 5;
string text5 = "\r\n<!-- **" + this.RepeatString("*", num1) + "* -->";
enumerator1 = list1.GetEnumerator();
try
{
while (enumerator1.MoveNext())
{
text4 = (string) enumerator1.Current;
text10 = text5;
text5 = text10 + "\r\n<!-- * " + text4 + this.RepeatString(" ", num1 - text4.Length) + "* -->";
}
}
finally
{
disposable1 = enumerator1 as IDisposable;
if (disposable1 != null)
{
disposable1.Dispose();
}
}
text5 = text5 + "\r\n<!-- **" + this.RepeatString("*", num1) + "* -->\r\n";
this.Page.RegisterClientScriptBlock("FreeTextBoxInfo", text5);
}
if (!this.Page.IsStartupScriptRegistered("FreeTextBox_" + this.ClientID + "_Startup"))
{
ArrayList list2 = new ArrayList();
ArrayList list3 = new ArrayList();
if (this.EnableToolbars)
{
foreach (Toolbar toolbar1 in this.Toolbars)
{
foreach (ToolbarItem item1 in toolbar1.Items)
{
if (this.license.IsPro || !item1.isProFeature)
{
if (item1 is ToolbarButton)
{
ToolbarButton button1 = (ToolbarButton) item1;
string text6 = "new FTB_Button('" + this.CreateUniqueToolbarItemID(toolbar1, item1) + "','" + button1.CommandIdentifier + "'";
if (button1.BuiltInScript != string.Empty)
{
text6 = text6 + ",function() { " + button1.BuiltInScript.Replace("\r", "").Replace("\n", "").Replace("\t", "") + " }";
}
else if (button1.ScriptBlock != string.Empty)
{
text6 = text6 + ",function() { " + button1.ScriptBlock.Replace("\r", "").Replace("\n", "").Replace("\t", "") + " }";
}
else
{
text6 = text6 + ",null";
}
if (button1.BuiltInStateScript != string.Empty)
{
text6 = text6 + ",function() { " + button1.BuiltInStateScript.Replace("\r", "").Replace("\n", "").Replace("\t", "") + " }";
}
else if (button1.StateScriptBlock != string.Empty)
{
text6 = text6 + ",function() { " + button1.StateScriptBlock.Replace("\r", "").Replace("\n", "").Replace("\t", "") + " }";
}
else
{
text6 = text6 + ",null";
}
text6 = text6 + "," + button1.htmlModeEnabled.ToString().ToLower();
if (button1.BuiltInEnabledScript != string.Empty)
{
text6 = text6 + ",function() { " + button1.BuiltInEnabledScript.Replace("\r", "").Replace("\n", "").Replace("\t", "") + " }";
}
else if (button1.EnabledScriptBlock != string.Empty)
{
text6 = text6 + ",function() { " + button1.EnabledScriptBlock.Replace("\r", "").Replace("\n", "").Replace("\t", "") + " }";
}
else
{
text6 = text6 + ",null";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -