SvgVisualElementStyle.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Text;
  5. using System.Reflection;
  6. using System.ComponentModel;
  7. using Svg.DataTypes;
  8. using System.Text.RegularExpressions;
  9. using System.Linq;
  10. #pragma warning disable
  11. namespace Svg
  12. {
  13. public abstract partial class SvgVisualElement
  14. {
  15. /// <summary>
  16. /// Gets or sets a value to determine whether the element will be rendered.
  17. /// </summary>
  18. [TypeConverter(typeof(SvgBoolConverter))]
  19. [SvgAttribute("visibility")]
  20. public virtual bool Visible
  21. {
  22. get { return (this.Attributes["visibility"] == null) ? true : (bool)this.Attributes["visibility"]; }
  23. set { this.Attributes["visibility"] = value; }
  24. }
  25. /// <summary>
  26. /// Gets or sets a value to determine whether the element will be rendered.
  27. /// Needed to support SVG attribute display="none"
  28. /// </summary>
  29. [SvgAttribute("display")]
  30. public virtual string Display
  31. {
  32. get { return this.Attributes["display"] as string; }
  33. set { this.Attributes["display"] = value; }
  34. }
  35. // Displayable - false if attribute display="none", true otherwise
  36. protected virtual bool Displayable
  37. {
  38. get
  39. {
  40. string checkForDisplayNone = this.Attributes["display"] as string;
  41. if ((!string.IsNullOrEmpty(checkForDisplayNone)) && (checkForDisplayNone == "none"))
  42. return false;
  43. else
  44. return true;
  45. }
  46. }
  47. /// <summary>
  48. /// Gets or sets the fill <see cref="SvgPaintServer"/> of this element.
  49. /// </summary>
  50. [SvgAttribute("enable-background")]
  51. public virtual string EnableBackground
  52. {
  53. get { return this.Attributes["enable-background"] as string; }
  54. set { this.Attributes["enable-background"] = value; }
  55. }
  56. }
  57. }
  58. #pragma warning restore