📄 comboboxbuilder.cs
字号:
using System;
using System.Web;
using System.Web.UI;
namespace WebCombobox {
/// <summary>
/// Summary description for ComboBoxBuilder.
/// </summary>
internal class ComboBoxBuilder : ControlBuilder {
public ComboBoxBuilder(){
//
// TODO: Add constructor logic here
//
}
public override bool AllowWhitespaceLiterals() {
return false;
}
public override Type GetChildControlType(string tagName, System.Collections.IDictionary attribs) {
string szTagName = tagName.ToLower();
int colon = szTagName.IndexOf(':');
if ((colon >= 0) && (colon < (szTagName.Length + 1))) {
// Separate the tagname from the namespace
szTagName = szTagName.Substring(colon + 1, szTagName.Length - colon - 1);
}
if (String.Compare(szTagName, "option", true, System.Globalization.CultureInfo.InvariantCulture) == 0 ||
String.Compare(szTagName, "listitem", true, System.Globalization.CultureInfo.InvariantCulture) == 0 ) {
return typeof(System.Web.UI.WebControls.ListItem);
}
// No Type was found, throw an exception
throw new Exception(String.Format("Invalid child with tagname \"{0}\"", tagName));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -