RowStyle.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. //#########################################################################################
  2. //★★★★★★★ http://www.cnpopsoft.com [华普软件] ★★★★★★★
  3. //★★★★★★★ 华普软件 - VB & C#.NET 专业论文与源码荟萃! ★★★★★★★
  4. //#########################################################################################
  5. /*
  6. * Copyright ?2005, Mathew Hall
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification,
  10. * are permitted provided that the following conditions are met:
  11. *
  12. * - Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. *
  15. * - Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  22. * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  23. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  24. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  25. * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  26. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  28. * OF SUCH DAMAGE.
  29. */
  30. using System;
  31. using System.ComponentModel;
  32. using System.Drawing;
  33. namespace XPTable.Models
  34. {
  35. /// <summary>
  36. /// Stores visual appearance related properties for a Row
  37. /// </summary>
  38. public class RowStyle
  39. {
  40. #region Class Data
  41. /// <summary>
  42. /// The background color of the Row
  43. /// </summary>
  44. private Color backColor;
  45. /// <summary>
  46. /// The foreground color of the Row
  47. /// </summary>
  48. private Color foreColor;
  49. /// <summary>
  50. /// The font used to draw the text in the Row
  51. /// </summary>
  52. private Font font;
  53. /// <summary>
  54. /// The alignment of the text in the Row
  55. /// </summary>
  56. private RowAlignment alignment;
  57. #endregion
  58. #region Constructor
  59. /// <summary>
  60. /// Initializes a new instance of the RowStyle class with default settings
  61. /// </summary>
  62. public RowStyle()
  63. {
  64. this.backColor = Color.Empty;
  65. this.foreColor = Color.Empty;
  66. this.font = null;
  67. this.alignment = RowAlignment.Center;
  68. }
  69. #endregion
  70. #region Properties
  71. /// <summary>
  72. /// Gets or sets the Font used by the Row
  73. /// </summary>
  74. [Category("Appearance"),
  75. Description("The font used to display text in the row")]
  76. public Font Font
  77. {
  78. get
  79. {
  80. return this.font;
  81. }
  82. set
  83. {
  84. this.font = value;
  85. }
  86. }
  87. /// <summary>
  88. /// Gets or sets the background color for the Row
  89. /// </summary>
  90. [Category("Appearance"),
  91. Description("The background color used to display text and graphics in the row")]
  92. public Color BackColor
  93. {
  94. get
  95. {
  96. return this.backColor;
  97. }
  98. set
  99. {
  100. this.backColor = value;
  101. }
  102. }
  103. /// <summary>
  104. /// Gets or sets the foreground color for the Row
  105. /// </summary>
  106. [Category("Appearance"),
  107. Description("The foreground color used to display text and graphics in the row")]
  108. public Color ForeColor
  109. {
  110. get
  111. {
  112. return this.foreColor;
  113. }
  114. set
  115. {
  116. this.foreColor = value;
  117. }
  118. }
  119. /// <summary>
  120. /// Gets or sets the vertical alignment of the text displayed in the Row
  121. /// </summary>
  122. [Category("Appearance"),
  123. DefaultValue(RowAlignment.Center),
  124. Description("The vertical alignment of the objects displayed in the row")]
  125. public RowAlignment Alignment
  126. {
  127. get
  128. {
  129. return this.alignment;
  130. }
  131. set
  132. {
  133. this.alignment = value;
  134. }
  135. }
  136. #endregion
  137. }
  138. }