Exemplo n.º 1
0
 /// <summary>
 /// Raises the <see cref="E:RemovingAttribute" /> event.
 /// </summary>
 /// <param name="e">The <see cref="RemovingAttributeEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRemovingAttribute(RemovingAttributeEventArgs e)
 {
     if (RemovingAttribute != null)
     {
         RemovingAttribute(this, e);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Removes an attribute from the document.
        /// </summary>
        /// <param name="tag">Tag the attribute belongs to</param>
        /// <param name="attribute">Attribute to be removed</param>
        /// <param name="reason">Reason for removal</param>
        private void RemoveAttribute(IElement tag, IAttr attribute, RemoveReason reason)
        {
            var e = new RemovingAttributeEventArgs {
                Tag = tag, Attribute = attribute, Reason = reason
            };

            OnRemovingAttribute(e);
            if (!e.Cancel)
            {
                tag.RemoveAttribute(attribute.Name);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Remove an attribute from the document.
        /// </summary>
        /// <param name="tag">tag where the attribute to belongs</param>
        /// <param name="attribute">to be removed</param>
        private void RemoveAttribute(IDomObject tag, KeyValuePair <string, string> attribute)
        {
            var e = new RemovingAttributeEventArgs {
                Attribute = attribute
            };

            OnRemovingAttribute(e);
            if (!e.Cancel)
            {
                tag.RemoveAttribute(attribute.Key);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Raises the <see cref="E:RemovingAttribute" /> event.
 /// </summary>
 /// <param name="e">The <see cref="RemovingAttributeEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRemovingAttribute(RemovingAttributeEventArgs e)
 {
     RemovingAttribute?.Invoke(this, e);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Remove an attribute from the document.
 /// </summary>
 /// <param name="tag">tag where the attribute to belongs</param>
 /// <param name="attribute">to be removed</param>
 private void RemoveAttribute(IDomObject tag, KeyValuePair<string, string> attribute)
 {
     var e = new RemovingAttributeEventArgs { Attribute = attribute };
     OnRemovingAttribute(e);
     if (!e.Cancel) tag.RemoveAttribute(attribute.Key);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Raises the <see cref="E:RemovingAttribute" /> event.
 /// </summary>
 /// <param name="e">The <see cref="RemovingAttributeEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRemovingAttribute(RemovingAttributeEventArgs e)
 {
     if (RemovingAttribute != null) RemovingAttribute(this, e);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Remove an attribute from the document.
 /// </summary>
 /// <param name="tag">tag where the attribute to belongs</param>
 /// <param name="attribute">to be removed</param>
 /// <param name="reason">reason why to be removed</param>
 private void RemoveAttribute(IElement tag, IAttr attribute, RemoveReason reason)
 {
     var e = new RemovingAttributeEventArgs { Tag = tag, Attribute = attribute, Reason = reason };
     OnRemovingAttribute(e);
     if (!e.Cancel) tag.RemoveAttribute(attribute.Name);
 }