本文整理汇总了C#中HtmlTextWriterAttribute类的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriterAttribute类的具体用法?C# HtmlTextWriterAttribute怎么用?C# HtmlTextWriterAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HtmlTextWriterAttribute类属于命名空间,在下文中一共展示了HtmlTextWriterAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAttribute
protected override void AddAttribute (string name, string value, HtmlTextWriterAttribute key)
{
output.WriteLine ("{0:###0} AddAttribute ({1}, {2}, {3}))", NextIndex (), name, value, key);
if (full_trace)
WriteTrace (new StackTrace ());
base.AddAttribute (name, value, key);
}
示例2: PendingAttribute
public PendingAttribute (string name, string value, HtmlTextWriterAttribute a, bool encode, bool know_encode)
{
this.name = name;
this.value = value;
this.a = a;
this.encode = encode;
this.know_encode = know_encode;
}
示例3: AddAttribute
public override void AddAttribute(HtmlTextWriterAttribute key, string value)
{
if (((key == HtmlTextWriterAttribute.Src) || (key == HtmlTextWriterAttribute.Href)) || (key == HtmlTextWriterAttribute.Background))
{
base.AddAttribute(key.ToString(), value, key);
}
else
{
base.AddAttribute(key, value);
}
}
示例4: AddAttribute
public override void AddAttribute(HtmlTextWriterAttribute key, string value)
{
if (multiValueAttrs != null && multiValueAttrs.Contains(key))
{
if (!attrValues.ContainsKey(key))
attrValues.Add(key, new List<string>());
attrValues[key].Add(value);
}
else
{
base.AddAttribute(key, value);
}
}
示例5: AddAttribute
public override void AddAttribute(HtmlTextWriterAttribute key, string value)
{
if (_allowedMultiValueAttrs.Contains(key))
{
if (!_attrValues.ContainsKey(key))
_attrValues.Add(key, new List<string>());
_attrValues[key].Add(value);
}
else
{
base.AddAttribute(key, value);
}
}
示例6: OnAttributeRender
protected override bool OnAttributeRender(string name, string value, HtmlTextWriterAttribute key)
{
Hashtable hashtable = (Hashtable) this._recognizedAttributes[base.TagName];
if ((hashtable == null) || (hashtable[name] == null))
{
if (this._globalSuppressedAttributes[name] != null)
{
return false;
}
Hashtable hashtable2 = (Hashtable) this._suppressedAttributes[base.TagName];
if ((hashtable2 != null) && (hashtable2[name] != null))
{
return false;
}
}
return true;
}
示例7: OnAttributeRender
/// <devdoc>
/// Override to filter out unnecessary attributes
/// </devdoc>
protected override bool OnAttributeRender(string name, string value, HtmlTextWriterAttribute key) {
Hashtable elementRecognizedAttributes = (Hashtable)_recognizedAttributes[TagName];
if (elementRecognizedAttributes != null && elementRecognizedAttributes[name] != null) {
return true;
}
if (_globalSuppressedAttributes[name] != null) {
return false;
}
Hashtable elementSuppressedAttributes = (Hashtable)_suppressedAttributes[TagName];
if (elementSuppressedAttributes != null && elementSuppressedAttributes[name] != null) {
return false;
}
return true;
}
示例8: Attr
/// <summary>
/// Applies the value to the specified attribute to the HtmlTextWriter
/// this instance contains.
/// </summary>
/// <param name="key">The attribute to set.</param>
/// <param name="value">The value to set to the attribute.</param>
/// <returns>The attribute manager.</returns>
public HtmlAttributeManager Attr(HtmlTextWriterAttribute key, string value)
{
Writer.AddAttribute(key, value);
return this;
}
示例9: AddAttribute
public override void AddAttribute(HtmlTextWriterAttribute key, String value)
{
if (HasRenderedFirstTag) {
base.AddAttribute(key, value);
} else if (key == HtmlTextWriterAttribute.Onclick) {
value +=
";(function(e){" +
"setTimeout(function(){" +
"e.disabled=(window.Page_IsValid !== true) ? false : (e.form && e.form.checkValidity && e.form.checkValidity());" +
"}, 0);" +
"})(this);";
base.AddAttribute(key, value);
} else {
base.AddAttribute(key, value);
}
}
示例10: OnAttributeRender
protected virtual bool OnAttributeRender(string name, string value, HtmlTextWriterAttribute key) {
return true;
}
示例11: IsAttributeDefined
protected bool IsAttributeDefined(HtmlTextWriterAttribute key) {
for (int i = 0; i < _attrCount; i++) {
if (_attrList[i].key == key) {
return true;
}
}
return false;
}
示例12: EncodeAttributeValue
protected virtual string EncodeAttributeValue(HtmlTextWriterAttribute attrKey, string value) {
bool encode = true;
if (0 <= (int)attrKey && (int)attrKey < _attrNameLookupArray.Length) {
encode = _attrNameLookupArray[(int)attrKey].encode;
}
return EncodeAttributeValue(value, encode);
}
示例13: AddAttribute
protected virtual void AddAttribute(string name, string value, HtmlTextWriterAttribute key) {
AddAttribute(name, value, key, false, false);
}
示例14: GetAttributeName
protected string GetAttributeName(HtmlTextWriterAttribute attrKey)
{
if ((attrKey >= HtmlTextWriterAttribute.Accesskey) && (attrKey < _attrNameLookupArray.Length))
{
return _attrNameLookupArray[(int) attrKey].name;
}
return string.Empty;
}
示例15: RegisterAttribute
private static void RegisterAttribute(string name, HtmlTextWriterAttribute key, bool encode, bool isUrl) {
string nameLCase = name.ToLower(CultureInfo.InvariantCulture);
_attrKeyLookupTable.Add(nameLCase, key);
if ((int)key < _attrNameLookupArray.Length) {
_attrNameLookupArray[(int)key] = new AttributeInformation(name, encode, isUrl);
}
}