/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/XshdSpan.cs

http://github.com/icsharpcode/ILSpy · C# · 97 lines · 28 code · 12 blank · 57 comment · 0 complexity · 04b3b2585241047d3c91323dad5593fd MD5 · raw file

  1. // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
  2. //
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy of this
  4. // software and associated documentation files (the "Software"), to deal in the Software
  5. // without restriction, including without limitation the rights to use, copy, modify, merge,
  6. // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
  7. // to whom the Software is furnished to do so, subject to the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be included in all copies or
  10. // substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  13. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  14. // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
  15. // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  17. // DEALINGS IN THE SOFTWARE.
  18. using System;
  19. namespace ICSharpCode.AvalonEdit.Highlighting.Xshd
  20. {
  21. /// <summary>
  22. /// Specifies the type of the regex.
  23. /// </summary>
  24. public enum XshdRegexType
  25. {
  26. /// <summary>
  27. /// Normal regex. Used when the regex was specified as attribute.
  28. /// </summary>
  29. Default,
  30. /// <summary>
  31. /// Ignore pattern whitespace / allow regex comments. Used when the regex was specified as text element.
  32. /// </summary>
  33. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly",
  34. Justification = "Using the same case as the RegexOption")]
  35. IgnorePatternWhitespace
  36. }
  37. /// <summary>
  38. /// &lt;Span&gt; element.
  39. /// </summary>
  40. [Serializable]
  41. public class XshdSpan : XshdElement
  42. {
  43. /// <summary>
  44. /// Gets/sets the begin regex.
  45. /// </summary>
  46. public string BeginRegex { get; set; }
  47. /// <summary>
  48. /// Gets/sets the begin regex type.
  49. /// </summary>
  50. public XshdRegexType BeginRegexType { get; set; }
  51. /// <summary>
  52. /// Gets/sets the end regex.
  53. /// </summary>
  54. public string EndRegex { get; set; }
  55. /// <summary>
  56. /// Gets/sets the end regex type.
  57. /// </summary>
  58. public XshdRegexType EndRegexType { get; set; }
  59. /// <summary>
  60. /// Gets/sets whether the span is multiline.
  61. /// </summary>
  62. public bool Multiline { get; set; }
  63. /// <summary>
  64. /// Gets/sets the rule set reference.
  65. /// </summary>
  66. public XshdReference<XshdRuleSet> RuleSetReference { get; set; }
  67. /// <summary>
  68. /// Gets/sets the span color.
  69. /// </summary>
  70. public XshdReference<XshdColor> SpanColorReference { get; set; }
  71. /// <summary>
  72. /// Gets/sets the span begin color.
  73. /// </summary>
  74. public XshdReference<XshdColor> BeginColorReference { get; set; }
  75. /// <summary>
  76. /// Gets/sets the span end color.
  77. /// </summary>
  78. public XshdReference<XshdColor> EndColorReference { get; set; }
  79. /// <inheritdoc/>
  80. public override object AcceptVisitor(IXshdVisitor visitor)
  81. {
  82. return visitor.VisitSpan(this);
  83. }
  84. }
  85. }