/// <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> /// 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); } }
/// <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); } }
/// <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); }
/// <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); }
/// <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); }