📄 freetextbox.cs
字号:
writer.WriteLine("</div>");
writer.WriteLine("</table>");
}
protected virtual void RenderTabs(HtmlTextWriter writer)
{
string text1 = this.ClientID + "_TabOn";
string text2 = this.ClientID + "_TabOffRight";
string text3 = this.ClientID + "_StartTabOn";
if (this.StartMode == EditorMode.HtmlMode)
{
text3 = this.ClientID + "_StartTabOff";
text1 = this.ClientID + "_TabOffLeft";
text2 = this.ClientID + "_TabOn";
}
writer.WriteLine("\r\n\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse:collapse;\">\r\n\t\t<tr id=\"" + this.ClientID + "_TabRow\">\r\n\t\t\t<td class=\"" + text3 + "\">\r\n\t\t\t\t \r\n\t\t\t</td>\r\n\t\t\t<td class=\"" + text1 + "\" id=\"" + this.ClientID + "_designModeTab\" unselectable=\"on\">\r\n\t\t\t\t<nobr><img unselectable=\"on\" src=\"" + this.CreateResourceString("mode.design", ResourceType.Button) + "\" align=\"absmiddle\" width=\"21\" height=\"20\"> " + this.resourceManager.GetString("DesignModeTab") + "</nobr>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"" + text2 + "\" ID=\"" + this.ClientID + "_htmlModeTab\" unselectable=\"on\">\r\n\t\t\t\t<nobr><img unselectable=\"on\" SRC=\"" + this.CreateResourceString("mode.html", ResourceType.Button) + "\" align=\"absmiddle\" width=\"21\" height=\"20\"> " + this.resourceManager.GetString("HtmlModeTab") + "</nobr>\r\n\t\t\t</td>\r\n\t\t\t<td class=\"" + this.ClientID + "_EndTab\">\r\n\t\t\t\t<div id=\"" + this.ClientID + "_AncestorArea\" class=\"" + this.ClientID + "_AncestorArea\"></div>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</table>\r\n\t");
}
protected virtual void RenderTabStyles(HtmlTextWriter writer)
{
writer.WriteLine("\r\n." + this.ClientID + "_StartTabOn {\r\n\tfont: 10pt MS Sans Serif;\r\n\tpadding: 1px;\r\n\tborder-left: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tborder-right: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorLight) + ";\r\n\tborder-top: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-bottom: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tbackground-color: " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n}\r\n." + this.ClientID + "_StartTabOff {\r\n\tfont: 10pt MS Sans Serif;\r\n\tpadding:1px;\r\n\tborder-left: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tborder-right: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-top: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-bottom: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tbackground-color: " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n}\r\n." + this.ClientID + "_TabOn {\r\n\tfont: 8pt MS Sans Serif;\r\n\tpadding:1px;\r\n\tpadding-left:5px;\r\n\tpadding-right:5px;\r\n\tborder-left: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorLight) + ";\r\n\tborder-right: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-top: 1px solid " + ColorTranslator.ToHtml(this.BackColor) + ";\r\n\tborder-bottom: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tbackground-color: " + ColorTranslator.ToHtml(this.BackColor) + ";\r\n}\r\n." + this.ClientID + "_TabOffRight {\r\n\tfont: 8pt MS Sans Serif;\r\n\tpadding:1px;\r\n\tpadding-left:5px;\r\n\tpadding-right:5px;\r\n\tborder-left: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-right: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-top: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-bottom: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tbackground-color: " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n}\r\n." + this.ClientID + "_TabOffLeft {\r\n\tfont: 8pt MS Sans Serif;\r\n\tpadding:1px;\r\n\tpadding-left:5px;\r\n\tpadding-right:5px;\r\n\tborder-left: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-right: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorLight) + ";\r\n\tborder-top: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-bottom: 1px solid " + ColorTranslator.ToHtml(this.BackColor) + ";\r\n\tbackground-color: " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n}\r\n." + this.ClientID + "_EndTab {\r\n\tfont: 10pt MS Sans Serif;\r\n\twidth: 100%;\r\n\tpadding:1px;\r\n\tborder-left: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tborder-right: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tborder-top: 1px solid " + ColorTranslator.ToHtml(this.GutterBorderColorDark) + ";\r\n\tborder-bottom: 1px solid " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n\tbackground-color: " + ColorTranslator.ToHtml(this.GutterBackColor) + ";\r\n}\r\n." + this.ClientID + "_AncestorArea {\r\n\t" + (!this.ShowTagPath ? "display:none;" : "") + "\r\n\tmargin-left: 4px;\r\n}\r\n." + this.ClientID + "_AncestorArea a {\r\n\tpadding: 1px;\r\n\tmargin-left: 2px;\r\n\tmargin-right: 2px;\r\n\tborder: 1px solid #808080;\t\r\n\tcolor: #000;\r\n\tfont-family: arial;\r\n\tfont-size: 11px;\r\n}\r\n." + this.ClientID + "_AncestorArea a:link, ." + this.ClientID + "_AncestorArea a:visited, ." + this.ClientID + "_AncestorArea a:active {\r\n\tbackground-color: transparent;\r\n\ttext-decoration: none;\r\n}\r\n." + this.ClientID + "_AncestorArea a:hover {\r\n\ttext-decoration: none;\r\n\tbackground-color: #316AC5;\r\n\tborder: 1px solid #fff;\r\n\tcolor:#fff;\r\n}\r\n");
}
public virtual void RenderToolbar(HtmlTextWriter writer, Toolbar toolbar)
{
writer.WriteLine("<div class=\"" + this.ClientID + "_Toolbar\">");
writer.Write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" " + (this.ToolbarBackgroundImage ? ("background=\"" + this.CreateResourceString("toolbar." + RepeatDirection.Horizontal.ToString().ToLower() + ".background", ResourceType.Toolbar) + "\"") : "") + "><tr><td border=\"0\" unselectable=\"on\">");
writer.Write("<img src=\"" + this.CreateResourceString("toolbar." + toolbar.RepeatDirection.ToString().ToLower() + ".start", ResourceType.Toolbar) + "\" align=\"center\" />");
if (toolbar.RepeatDirection == RepeatDirection.Horizontal)
{
writer.Write("</td><td>");
}
writer.Write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">");
if (toolbar.RepeatDirection == RepeatDirection.Horizontal)
{
writer.Write("<tr>");
}
foreach (ToolbarItem item1 in toolbar.Items)
{
if (this.license.IsPro || !item1.isProFeature)
{
if (item1 is ToolbarButton)
{
ToolbarButton button1 = (ToolbarButton) item1;
this.RenderToolbarButton(writer, toolbar, button1);
}
else if (item1 is ToolbarDropDownList)
{
ToolbarDropDownList list1 = (ToolbarDropDownList) item1;
this.RenderToolbarDropDownList(writer, toolbar, list1);
}
else if (item1 is ToolbarSeparator)
{
this.RenderToolbarSeparator(writer, toolbar);
}
}
}
if (toolbar.RepeatDirection == RepeatDirection.Horizontal)
{
writer.Write("</tr>");
}
writer.Write("</table>");
if (toolbar.RepeatDirection == RepeatDirection.Horizontal)
{
writer.Write("</td><td>");
}
writer.Write("<img src=\"" + this.CreateResourceString("toolbar." + toolbar.RepeatDirection.ToString().ToLower() + ".end", ResourceType.Toolbar) + "\" border=\"0\" unselectable=\"on\" align=\"center\" />");
writer.Write("</td></tr></table>");
writer.Write("</div>");
}
public virtual void RenderToolbarButton(HtmlTextWriter writer, Toolbar toolbar, ToolbarButton toolbarButton)
{
if (toolbarButton.IsBuiltIn)
{
this.SetToolbarButtonLanguage(toolbarButton);
}
if (toolbar.RepeatDirection == RepeatDirection.Vertical)
{
writer.WriteLine("<tr>");
}
writer.Write("<td id=\"" + this.CreateUniqueToolbarItemID(toolbar, toolbarButton) + "\" class=\"" + this.ClientID + "_Button_Off_Out\">");
if (toolbarButton.isBuiltIn)
{
writer.Write(string.Concat(new object[] { "<img src=\"", this.CreateResourceString(toolbarButton.ButtonImage, ResourceType.Button), "\" border=\"0\" title=\"", toolbarButton.Title, "\" unselectable=\"on\" width=\"", this.ButtonWidth, "\" height=\"", this.ButtonHeight, "\" tabindex=\"-1\" style=\"margin:0px;padding:0px;\" align=\"center\" />" }));
}
else
{
writer.Write(string.Concat(new object[] { "<img src=\"", this.SupportFolder, this.ButtonFolder, "/", toolbarButton.ButtonImage, ".", this.ButtonFileExtention, "\" border=\"0\" title=\"", toolbarButton.Title, "\" unselectable=\"on\" width=\"", this.ButtonWidth, "\" height=\"", this.ButtonHeight, "\" tabindex=\"-1\" align=\"center\" />" }));
}
writer.Write("</td>\n");
if (toolbar.RepeatDirection == RepeatDirection.Vertical)
{
writer.Write("</tr>");
}
}
public virtual void RenderToolbarDropDownList(HtmlTextWriter writer, Toolbar toolbar, ToolbarDropDownList toolbarDropDownList)
{
if (toolbarDropDownList.IsBuiltIn)
{
this.SetToolbarDropDownListLanguage(toolbarDropDownList);
}
if (toolbar.RepeatDirection == RepeatDirection.Vertical)
{
writer.WriteLine("<tr>");
}
writer.Write("<td style=\"padding-left:4px;\" unselectable=\"on\">");
writer.Write("<select id=\"" + this.CreateUniqueToolbarItemID(toolbar, toolbarDropDownList) + "\" TabIndex=\"-1\" " + ((this.DropDownListCssClass != string.Empty) ? (" class=\"" + this.DropDownListCssClass + "\"") : "") + ((this.TextDirection == FreeTextBoxControls.TextDirection.RightToLeft) ? "style=\"direction:rtl;\"" : "") + ">");
writer.Write("<option value=\"\">" + toolbarDropDownList.Title + "</option>");
foreach (ToolbarListItem item1 in toolbarDropDownList.Items)
{
if (toolbarDropDownList is ParagraphMenu)
{
writer.Write("<option value=\"" + item1.Value + "\"");
}
else
{
writer.Write("<option value=\"" + this.Page.Server.HtmlEncode(item1.Value) + "\"");
}
if (item1.BackColor != Color.Transparent)
{
writer.Write(" style=\"background-color: " + ColorTranslator.ToHtml(item1.BackColor) + ";");
if (item1.BackColor.GetBrightness() < 0.4)
{
writer.Write("color: #FFFFFF;");
}
writer.Write("\"");
}
writer.Write(">" + item1.Text + "</option>\n");
}
writer.Write("</select>");
writer.Write("</td>");
if (toolbar.RepeatDirection == RepeatDirection.Vertical)
{
writer.Write("</tr>");
}
}
public virtual void RenderToolbarSeparator(HtmlTextWriter writer, Toolbar toolbar)
{
if (toolbar.RepeatDirection == RepeatDirection.Vertical)
{
writer.WriteLine("<tr>");
}
writer.WriteLine("<td><img src=\"" + this.CreateResourceString("separator." + toolbar.RepeatDirection.ToString().ToLower(), ResourceType.Toolbar) + "\" border=0 unselectable=\"on\"></td>");
if (toolbar.RepeatDirection == RepeatDirection.Vertical)
{
writer.WriteLine("</tr>");
}
}
private string RepeatString(string input, int times)
{
string text1 = "";
for (int num1 = 1; num1 <= times; num1++)
{
text1 = text1 + input;
}
return text1;
}
protected override object SaveViewState()
{
HttpContext.Current.Trace.Write("FreeTextBox", "Saving");
object[] objArray1 = new object[4];
objArray1[0] = base.SaveViewState();
if (this.toolbars != null)
{
objArray1[1] = ((IStateManager) this.toolbars).SaveViewState();
}
if (this.buttonStyle != null)
{
objArray1[2] = ((IStateManager) this.buttonStyle).SaveViewState();
}
if (this.buttonStyleActive != null)
{
objArray1[3] = ((IStateManager) this.buttonStyleActive).SaveViewState();
}
return objArray1;
}
private void SetButtonStyle(ToolbarButtonStyle style, FreeTextBoxControls.ToolbarStyleConfiguration toolbarStyle, bool normal)
{
switch (toolbarStyle)
{
case FreeTextBoxControls.ToolbarStyleConfiguration.OfficeXP:
if (normal)
{
style.UseBackgroundImage = false;
style.UseOverBackgroundImage = false;
style.BackColor = Color.Transparent;
style.BorderColorLight = Color.Transparent;
style.BorderColorDark = Color.Transparent;
style.OverBackColor = ColorTranslator.FromHtml("#B5BDD6");
style.OverBorderColorLight = ColorTranslator.FromHtml("#3169C6");
style.OverBorderColorDark = ColorTranslator.FromHtml("#3169C6");
style.DownBackColor = ColorTranslator.FromHtml("#8592B5");
style.DownBorderColorLight = ColorTranslator.FromHtml("#3169C6");
style.DownBorderColorDark = ColorTranslator.FromHtml("#3169C6");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -