ScriptSecurityEventArgs.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System;
  2. using System.Collections.Generic;
  3. namespace FastReport.Utils
  4. {
  5. /// <summary>
  6. /// Script security event arguments.
  7. /// </summary>
  8. public class ScriptSecurityEventArgs : EventArgs
  9. {
  10. /// <summary>
  11. /// Gets the report language.
  12. /// </summary>
  13. /// <value>The report language.</value>
  14. public Language ReportLanguage
  15. {
  16. get
  17. {
  18. return Report.ScriptLanguage;
  19. }
  20. }
  21. private Report _report;
  22. /// <summary>
  23. /// Gets the report.
  24. /// </summary>
  25. /// <value>The report.</value>
  26. public Report Report
  27. {
  28. get
  29. {
  30. return _report;
  31. }
  32. }
  33. private string _reportScript;
  34. /// <summary>
  35. /// Gets the report script.
  36. /// </summary>
  37. /// <value>The report script.</value>
  38. public string ReportScript
  39. {
  40. get
  41. {
  42. return _reportScript;
  43. }
  44. }
  45. private string[] _references;
  46. /// <summary>
  47. /// Gets the references of script.
  48. /// </summary>
  49. /// <value>Script references</value>
  50. public string[] References
  51. {
  52. get
  53. {
  54. return _references;
  55. }
  56. }
  57. private bool _isValid = true;
  58. /// <summary>
  59. /// Gets or sets value if script is allowed to compile
  60. /// </summary>
  61. /// <value><c>true</c> if is valid; otherwise, <c>false</c>.</value>
  62. public bool IsValid
  63. {
  64. get
  65. {
  66. return _isValid;
  67. }
  68. set
  69. {
  70. _isValid = value;
  71. }
  72. }
  73. /// <summary>
  74. /// Initializes a new instance of the <see cref="T:FastReport.Utils.ScriptSecurityEventArgs"/> class.
  75. /// </summary>
  76. /// <param name="report">Report.</param>
  77. /// <param name="script">Report's script.</param>
  78. /// <param name="refs">Report's references.</param>
  79. public ScriptSecurityEventArgs(Report report, string script, string[] refs)
  80. {
  81. _report = report;
  82. _reportScript = script;
  83. _references = refs;
  84. }
  85. }
  86. }