示例#1
0
 /// <summary>
 /// Raises the <see cref="E:RemovingStyle" /> event.
 /// </summary>
 /// <param name="e">The <see cref="RemovingStyleEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRemovingStyle(RemovingStyleEventArgs e)
 {
     if (RemovingStyle != null)
     {
         RemovingStyle(this, e);
     }
 }
示例#2
0
        /// <summary>
        /// Removes a style from the document.
        /// </summary>
        /// <param name="tag">Tag the style belongs to</param>
        /// <param name="styles">Style rule that contains the style to be removed</param>
        /// <param name="style">Style to be removed</param>
        /// <param name="reason">Reason for removal</param>
        private void RemoveStyle(IElement tag, ICssStyleDeclaration styles, ICssProperty style, RemoveReason reason)
        {
            var e = new RemovingStyleEventArgs {
                Tag = tag, Style = style, Reason = reason
            };

            OnRemovingStyle(e);
            if (!e.Cancel)
            {
                styles.RemoveProperty(style.Name);
            }
        }
示例#3
0
        /// <summary>
        /// Remove a style from the document.
        /// </summary>
        /// <param name="styles">collection where the style to belongs</param>
        /// <param name="style">to be removed</param>
        private void RemoveStyle(ICSSStyleDeclaration styles, KeyValuePair <string, string> style)
        {
            var e = new RemovingStyleEventArgs {
                Style = style
            };

            OnRemovingStyle(e);
            if (!e.Cancel)
            {
                styles.RemoveStyle(style.Key);
            }
        }
示例#4
0
 /// <summary>
 /// Raises the <see cref="E:RemovingStyle" /> event.
 /// </summary>
 /// <param name="e">The <see cref="RemovingStyleEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRemovingStyle(RemovingStyleEventArgs e)
 {
     RemovingStyle?.Invoke(this, e);
 }
示例#5
0
 /// <summary>
 /// Remove a style from the document.
 /// </summary>
 /// <param name="styles">collection where the style to belongs</param>
 /// <param name="style">to be removed</param>
 private void RemoveStyle(ICSSStyleDeclaration styles, KeyValuePair<string, string> style)
 {
     var e = new RemovingStyleEventArgs { Style = style };
     OnRemovingStyle(e);
     if (!e.Cancel) styles.RemoveStyle(style.Key);
 }
示例#6
0
 /// <summary>
 /// Raises the <see cref="E:RemovingStyle" /> event.
 /// </summary>
 /// <param name="e">The <see cref="RemovingStyleEventArgs"/> instance containing the event data.</param>
 protected virtual void OnRemovingStyle(RemovingStyleEventArgs e)
 {
     if (RemovingStyle != null) RemovingStyle(this, e);
 }
 /// <summary>
 /// Remove a style from the document.
 /// </summary>
 /// <param name="tag">tag where the style belongs</param>
 /// <param name="styles">collection where the style to belongs</param>
 /// <param name="style">to be removed</param>
 /// <param name="reason">reason why to be removed</param>
 private void RemoveStyle(IElement tag, ICssStyleDeclaration styles, ICssProperty style, RemoveReason reason)
 {
     var e = new RemovingStyleEventArgs { Tag = tag, Style = style, Reason = reason };
     OnRemovingStyle(e);
     if (!e.Cancel) styles.RemoveProperty(style.Name);
 }