AboutForm.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System;
  2. using System.Windows.Forms;
  3. using FastReport.Utils;
  4. using System.Globalization;
  5. using FastReport.Editor;
  6. using System.Drawing;
  7. namespace FastReport.Forms
  8. {
  9. internal partial class AboutForm : BaseDialogForm
  10. {
  11. private void label5_Click(object sender, EventArgs e)
  12. {
  13. ProcessHelper.StartProcess(label5.Text);
  14. }
  15. private void AboutForm_Shown(object sender, EventArgs e)
  16. {
  17. }
  18. private void AboutForm_KeyDown(object sender, KeyEventArgs e)
  19. {
  20. if (e.KeyData == Keys.Escape)
  21. DialogResult = DialogResult.Cancel;
  22. }
  23. public override void Localize()
  24. {
  25. base.Localize();
  26. MyRes res = new MyRes("Forms,About");
  27. Text = res.Get("");
  28. #if WPF
  29. label1.Text = "FastReport.WPF";
  30. #elif AVALONIA
  31. label1.Text = "FastReport.Avalonia";
  32. #elif MONO
  33. label1.Text = "FastReport.Mono";
  34. #endif
  35. label2.Text = res.Get("Version") + " " + Config.Version
  36. #if Demo
  37. + " " + typeof(DataBand).Name[0].ToString() + typeof(Exception).Name[3].ToString() +
  38. typeof(Math).Name[0].ToString().ToLower() + typeof(Object).Name[0].ToString().ToLower()
  39. #endif
  40. #if TIMETRIAL
  41. + " " + typeof(Timer).Name[0].ToString() + typeof(Timer).Name[4].ToString() +
  42. typeof(Timer).Name[1].ToString() + typeof(Math).Name[1].ToString() + typeof(ListBox).Name[0].ToString().ToLower()
  43. #endif
  44. #if Academic
  45. + " " + typeof(AboutForm).Name[0].ToString() + typeof(Char).Name[0].ToString().ToLower() +
  46. typeof(Char).Name[2].ToString() + typeof(DataFormats).Name[0].ToString().ToLower() +
  47. typeof(Exception).Name[0].ToString().ToLower() + typeof(Math).Name[0].ToString().ToLower() +
  48. typeof(Exception).Name[6].ToString() + typeof(Char).Name[0].ToString().ToLower()
  49. #endif
  50. #if COMMUNITY
  51. + "\nCommunity Edition"
  52. #endif
  53. ;
  54. string company;
  55. if (CultureInfo.CurrentCulture.Name == "ru-RU")
  56. {
  57. company = " ООО Быстрые отчеты";
  58. label5.Text = "https://быстрыеотчеты.рф";
  59. }
  60. else
  61. {
  62. company = " Fast Reports Inc.";
  63. label5.Text = "https://www.fast-report.com";
  64. }
  65. label3.Text = "© 2008-" + DateTime.Now.Year.ToString() + company;
  66. label4.Text = res.Get("Visit");
  67. }
  68. public override void UpdateDpiDependencies()
  69. {
  70. base.UpdateDpiDependencies();
  71. #if AVALONIA
  72. this.ClientSize = this.LogicalToDevice(new Size(340, 225));
  73. #endif
  74. btnOk.Left = (ClientSize.Width - btnOk.Width) / 2;
  75. label1.Font = this.LogicalToDevice(new Font(label1.Font.FontFamily, 15.75f, label1.Font.Style));
  76. label2.Font = this.LogicalToDevice(new Font(label2.Font.FontFamily, 8F, FontStyle.Bold));
  77. label5.Font = this.LogicalToDevice(new Font(label5.Font.FontFamily, 8F, FontStyle.Underline));
  78. label3.Width = label4.Width = label5.Width = labelLine1.Width = ClientSize.Width;
  79. pictureBox1.Image = this.GetImage(CultureInfo.CurrentCulture.Name == "ru-RU" ? "bo.png" : "fr.png");
  80. }
  81. public AboutForm()
  82. {
  83. InitializeComponent();
  84. Localize();
  85. UpdateDpiDependencies();
  86. UIUtils.CheckRTL(this);
  87. }
  88. }
  89. }