FastM1nesweeperWizard.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using FastReport.Design;
  2. using FastReport.Forms;
  3. using FastReport.Utils;
  4. using System.IO;
  5. namespace FastReport.Wizards
  6. {
  7. internal class FastM1nesweeperWizard : EasterEggWizard
  8. {
  9. #region Private Fields
  10. private int bombs;
  11. private int columns;
  12. private int rows;
  13. #endregion Private Fields
  14. #region Public Methods
  15. public override bool Run(Designer designer)
  16. {
  17. using (Stream s = ResourceLoader.GetStream("Games.FastM1nesweeper.frx"))
  18. {
  19. if (LoadStreamToDesigner(s, designer))
  20. return true;
  21. }
  22. return false;
  23. }
  24. #endregion Public Methods
  25. #region Protected Methods
  26. protected override void ProcessPages(Report report)
  27. {
  28. base.ProcessPages(report);
  29. TextObject tBombs = report.FindObject("tBombs") as TextObject;
  30. if (tBombs != null)
  31. tBombs.Text = bombs.ToString();
  32. TextObject tRows = report.FindObject("tRows") as TextObject;
  33. if (tRows != null)
  34. tRows.Text = rows.ToString();
  35. TextObject tColumns = report.FindObject("tColumns") as TextObject;
  36. if (tColumns != null)
  37. tColumns.Text = columns.ToString();
  38. }
  39. protected override bool ShowDialog()
  40. {
  41. FastM1nesweeperForm form = new FastM1nesweeperForm();
  42. bool result = form.ShowDialog() == System.Windows.Forms.DialogResult.OK;
  43. bombs = form.Bombs;
  44. columns = form.Columns;
  45. rows = form.Rows;
  46. return result;
  47. }
  48. #endregion Protected Methods
  49. }
  50. }