AreaDesigner.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. //
  5. // Purpose: Design-time chart areas collection editor class
  6. //
  7. #if DESIGNER
  8. using System.Globalization;
  9. using FastReport.DataVisualization.Charting;
  10. namespace FastReport.Design.DataVisualization.Charting
  11. {
  12. /// <summary>
  13. /// Designer editor for the chart areas collection.
  14. /// </summary>
  15. internal class AreaCollectionEditor : ChartCollectionEditor
  16. {
  17. /// <summary>
  18. /// Default constructor
  19. /// </summary>
  20. public AreaCollectionEditor() : base(typeof(ChartAreaCollection))
  21. {
  22. }
  23. }
  24. /// <summary>
  25. /// Used for invoking windows forms MesageBox dialog.
  26. /// </summary>
  27. internal class DesignerMessageBoxDialog : IDesignerMessageBoxDialog
  28. {
  29. /// <summary>
  30. /// Shows Yes/No MessageBox.
  31. /// </summary>
  32. /// <param name="message">The message.</param>
  33. /// <returns>
  34. /// rue if user confirms with Yes
  35. /// </returns>
  36. bool IDesignerMessageBoxDialog.ShowQuestion(string message)
  37. {
  38. // Show dialog box to the user with Yes and No options
  39. DialogResult result = MessageBox.Show(
  40. message,
  41. SR.MessageChartTitle,
  42. MessageBoxButtons.YesNo,
  43. MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, GetMessageBoxOptions());
  44. return result == DialogResult.Yes;
  45. }
  46. // Gets the MessageBoxOptions based on the system Culture settings
  47. internal static MessageBoxOptions GetMessageBoxOptions()
  48. {
  49. if (CultureInfo.CurrentCulture.TextInfo.IsRightToLeft)
  50. return MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign;
  51. else
  52. return (MessageBoxOptions)0; // Unfortunately, the MessageBoxOptions enum doesn't have a predefined ".None" value.;
  53. }
  54. }
  55. }
  56. #endif