ExportObject.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. using FastReport.Utils;
  2. using System;
  3. using System.IO;
  4. namespace FastReport.Export
  5. {
  6. class ExportIEMObject
  7. {
  8. #region Private fields
  9. private TextRenderType textRenderType;
  10. private string text;
  11. private string originalText;
  12. private string bookmark;
  13. private Hyperlink hyperlink;
  14. private int styleIndex;
  15. private ExportIEMStyle style;
  16. private bool isText;
  17. private bool isRichText;
  18. private float left;
  19. private float top;
  20. private float width;
  21. private float height;
  22. private int counter;
  23. private System.Drawing.Image metafile;
  24. private MemoryStream pictureStream;
  25. private bool isBand;
  26. private string hash;
  27. private bool isBase;
  28. private object value;
  29. private bool isNumeric;
  30. private bool isDateTime;
  31. private bool isPercent;
  32. private bool isSvg;
  33. private Utils.InlineImageCache inlineImageCache;
  34. private ParagraphFormat paragraphFormat;
  35. private float tabWidth;
  36. private FloatCollection tabPositions;
  37. private bool autoSize;
  38. private int fx;
  39. private int fy;
  40. private int fdx;
  41. private int fdy;
  42. private bool exist;
  43. #endregion
  44. #region Private methods
  45. #endregion
  46. #region Public properties
  47. public bool AutoSize
  48. {
  49. get { return autoSize; }
  50. set { autoSize = value; }
  51. }
  52. public bool Base
  53. {
  54. get { return isBase; }
  55. set { isBase = value; }
  56. }
  57. public string Hash
  58. {
  59. get { return hash; }
  60. set { hash = value; }
  61. }
  62. public TextRenderType TextRenderType
  63. {
  64. get { return textRenderType; }
  65. set { textRenderType = value; }
  66. }
  67. /// <summary>
  68. /// This property for internal use only.
  69. /// </summary>
  70. public bool HtmlTags
  71. {
  72. get
  73. {
  74. switch (textRenderType)
  75. {
  76. case TextRenderType.HtmlTags:
  77. case TextRenderType.HtmlParagraph:
  78. return true;
  79. default:
  80. return false;
  81. }
  82. }
  83. set { textRenderType = value ? TextRenderType.HtmlTags : TextRenderType.Default; }
  84. }
  85. public string Text
  86. {
  87. get { return text; }
  88. set { text = value; }
  89. }
  90. public FloatCollection TabPositions
  91. {
  92. get { return tabPositions; }
  93. set { tabPositions = value; }
  94. }
  95. public string OriginalText
  96. {
  97. get { return originalText; }
  98. set { originalText = value; }
  99. }
  100. public string URL
  101. {
  102. get { return Hyperlink != null && Hyperlink.Kind == HyperlinkKind.URL ? Hyperlink.Value : ""; }
  103. }
  104. public string Bookmark
  105. {
  106. get { return bookmark; }
  107. set { bookmark = value; }
  108. }
  109. public Hyperlink Hyperlink
  110. {
  111. get { return hyperlink; }
  112. set { hyperlink = value; }
  113. }
  114. public int StyleIndex
  115. {
  116. get { return styleIndex; }
  117. set { styleIndex = value; }
  118. }
  119. public bool IsText
  120. {
  121. get { return isText; }
  122. set { isText = value; }
  123. }
  124. public bool IsRichText
  125. {
  126. get { return isRichText; }
  127. set { isRichText = value; }
  128. }
  129. public bool IsSvg
  130. {
  131. get { return isSvg; }
  132. set { isSvg = value; }
  133. }
  134. public float Left
  135. {
  136. get { return left; }
  137. set { left = value; }
  138. }
  139. public float Top
  140. {
  141. get { return top; }
  142. set { top = value; }
  143. }
  144. public float Width
  145. {
  146. get { return width; }
  147. set { width = value; }
  148. }
  149. public float Height
  150. {
  151. get { return height; }
  152. set { height = value; }
  153. }
  154. public ExportIEMStyle Style
  155. {
  156. get { return style; }
  157. set { style = value; }
  158. }
  159. public int Counter
  160. {
  161. get { return counter; }
  162. set { counter = value; }
  163. }
  164. public System.Drawing.Image Metafile
  165. {
  166. get { return metafile; }
  167. set { metafile = value; }
  168. }
  169. public MemoryStream PictureStream
  170. {
  171. get { return pictureStream; }
  172. set { pictureStream = value; }
  173. }
  174. public bool IsBand
  175. {
  176. get { return isBand; }
  177. set { isBand = value; }
  178. }
  179. public object Value
  180. {
  181. get { return value; }
  182. set { this.value = value; }
  183. }
  184. public bool IsNumeric
  185. {
  186. get { return isNumeric; }
  187. set { isNumeric = value; }
  188. }
  189. public bool IsDateTime
  190. {
  191. get { return isDateTime; }
  192. set { isDateTime = value; }
  193. }
  194. public bool IsPercent
  195. {
  196. get { return isPercent; }
  197. set { isPercent = value; }
  198. }
  199. public int x
  200. {
  201. get { return fx; }
  202. set { fx = value; }
  203. }
  204. public int y
  205. {
  206. get { return fy; }
  207. set { fy = value; }
  208. }
  209. public int dx
  210. {
  211. get { return fdx; }
  212. set { fdx = value; }
  213. }
  214. public int dy
  215. {
  216. get { return fdy; }
  217. set { fdy = value; }
  218. }
  219. public bool Exist
  220. {
  221. get { return exist; }
  222. set { exist = value; }
  223. }
  224. public Utils.InlineImageCache InlineImageCache
  225. {
  226. get { return inlineImageCache; }
  227. set { inlineImageCache = value; }
  228. }
  229. public ParagraphFormat ParagraphFormat
  230. {
  231. get { return paragraphFormat; }
  232. set { paragraphFormat = value; }
  233. }
  234. public float TabWidth
  235. {
  236. get { return tabWidth; }
  237. set { tabWidth = value; }
  238. }
  239. #endregion
  240. public ExportIEMObject()
  241. {
  242. isText = true;
  243. isNumeric = false;
  244. text = String.Empty;
  245. isBase = true;
  246. originalText = null;
  247. }
  248. }
  249. }