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); }
public override void AddAttribute (HtmlTextWriterAttribute key, string value, bool fEncode) { output.WriteLine ("{0:###0} AddAttribute ({1}, {2}, {3}))", NextIndex (), key, value, fEncode); if (full_trace) WriteTrace (new StackTrace ()); base.AddAttribute (key, value, fEncode); }
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; }
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); } }
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); } }
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); } }
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; }
/// <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; }
/// <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; }
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); } }
protected virtual bool OnAttributeRender(string name, string value, HtmlTextWriterAttribute key) { return true; }
protected bool IsAttributeDefined(HtmlTextWriterAttribute key) { for (int i = 0; i < _attrCount; i++) { if (_attrList[i].key == key) { return true; } } return false; }
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); }
protected virtual void AddAttribute(string name, string value, HtmlTextWriterAttribute key) { AddAttribute(name, value, key, false, false); }
protected string GetAttributeName(HtmlTextWriterAttribute attrKey) { if ((attrKey >= HtmlTextWriterAttribute.Accesskey) && (attrKey < _attrNameLookupArray.Length)) { return _attrNameLookupArray[(int) attrKey].name; } return string.Empty; }
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); } }
public virtual void AddAttribute(HtmlTextWriterAttribute key,string value, bool fEncode) { int attributeIndex = (int) key; if (attributeIndex >= 0 && attributeIndex < _attrNameLookupArray.Length) { AttributeInformation info = _attrNameLookupArray[attributeIndex]; AddAttribute(info.name,value,key, fEncode, info.isUrl); } }
protected override bool OnAttributeRender (string name, string value, HtmlTextWriterAttribute key) { // FIXME: // I checked every possible HtmlTextWriterAttribute key // and always throws ArgumentNullException. return (bool) attr_render [null]; }
private void AddAttribute(string name, string value, HtmlTextWriterAttribute key, bool encode, bool isUrl) { if(_attrList == null) { _attrList = new RenderAttribute[20]; } else if (_attrCount >= _attrList.Length) { RenderAttribute[] newArray = new RenderAttribute[_attrList.Length * 2]; Array.Copy(_attrList, newArray, _attrList.Length); _attrList = newArray; } RenderAttribute attr; attr.name = name; attr.value = value; attr.key = key; attr.encode = encode; attr.isUrl = isUrl; _attrList[_attrCount] = attr; _attrCount++; }
public virtual void AddAttribute(HtmlTextWriterAttribute key, string value, bool fEncode) {}
protected string GetAttributeName(HtmlTextWriterAttribute attrKey) { if ((int)attrKey >= 0 && (int)attrKey < _attrNameLookupArray.Length) return _attrNameLookupArray[(int)attrKey].name; return string.Empty; }
public bool PublicOnAttributeRender (string name, string value, HtmlTextWriterAttribute attr) { return OnAttributeRender (name, value, attr); }
protected bool IsAttributeDefined(HtmlTextWriterAttribute key, out string value) { value = null; for (int i = 0; i < _attrCount; i++) { if (_attrList[i].key == key) { value = _attrList[i].value; return true; } } return false; }
public string PublicGetAttributeName (HtmlTextWriterAttribute attrKey) { return GetAttributeName (attrKey); }
/// <summary> /// ・POSTデータから値を読み込んでコントロールの状態を復元します。 /// ・また、コントロールの状態が変わったらtrueを返します。 /// </summary> /// <param name="key">Attributeのkey</param> /// <param name="value">Attributeのvalue</param> public override void AddAttribute(HtmlTextWriterAttribute key, string value) { // 描画時にname属性にGroupNameを、value属性にUniqueIDを設定 switch (key) { case HtmlTextWriterAttribute.Name: base.AddAttribute(key, this._ctrl.GroupName); break; case HtmlTextWriterAttribute.Value: base.AddAttribute(key, this._ctrl.UniqueID); break; default: base.AddAttribute(key, value); break; } }
public static HtmlTextWriter Attribute(this HtmlTextWriter writer, HtmlTextWriterAttribute attribute, string content = "") { writer.AddAttribute(attribute, content); return writer; }
public override void AddAttribute(HtmlTextWriterAttribute key, String value) { if (HasRenderedFirstTag) { base.AddAttribute(key, value); } else if (key == HtmlTextWriterAttribute.Type) { // Ignore. } else if (key == HtmlTextWriterAttribute.Value) { // Ignore. } else { base.AddAttribute(key, value); } }
protected static void RegisterAttribute(string name, HtmlTextWriterAttribute key) { RegisterAttribute(name, key, false); }
/// <summary> /// Initializes a new instance of the HtmlAttribute class. /// </summary> /// <param name="attribute">The attribute.</param> /// <param name="value">The value of the attribute.</param> public HtmlAttribute(HtmlTextWriterAttribute attribute, string value) { this.Name = attribute.ToString().ToLower(); this.Value = value; }
private static void RegisterAttribute(string name, HtmlTextWriterAttribute key, bool encode) { RegisterAttribute(name, key, encode, false); }