ImportBase.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System.IO;
  2. namespace FastReport.Import
  3. {
  4. /// <summary>
  5. /// Base class for all import plugins.
  6. /// </summary>
  7. public class ImportBase
  8. {
  9. #region Fields
  10. private string name;
  11. private Report report;
  12. #endregion // Fields
  13. #region Properties
  14. /// <summary>
  15. /// Gets or sets the name of plugin.
  16. /// </summary>
  17. public string Name
  18. {
  19. get { return name; }
  20. protected set { name = value; }
  21. }
  22. /// <summary>
  23. /// Gets or sets reference to the report.
  24. /// </summary>
  25. public Report Report
  26. {
  27. get { return report; }
  28. protected set { report = value; }
  29. }
  30. #endregion // Properties
  31. #region Constructors
  32. /// <summary>
  33. /// Initializes a new instance of the <see cref="ImportBase"/> class with default settings.
  34. /// </summary>
  35. public ImportBase()
  36. {
  37. }
  38. #endregion // Constructors
  39. #region Public Methods
  40. /// <summary>
  41. /// Loads the specified file into specified report.
  42. /// </summary>
  43. /// <param name="report">Report object.</param>
  44. /// <param name="filename">File name.</param>
  45. public virtual void LoadReport(Report report, string filename)
  46. {
  47. report.Clear();
  48. }
  49. /// <summary>
  50. /// Loads the specified file into specified report from stream.
  51. /// </summary>
  52. /// <param name="report">Report object</param>
  53. /// <param name="content">File stream</param>
  54. public virtual void LoadReport(Report report, Stream content)
  55. {
  56. report.Clear();
  57. }
  58. #endregion // Public Methods
  59. }
  60. }