ConnectionEditorBase.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using FastReport.Controls;
  9. namespace FastReport.Data.ConnectionEditors
  10. {
  11. /// <summary>
  12. /// The base class for all connection editors. This control is used when you edit
  13. /// the connection in the Data Wizard.
  14. /// </summary>
  15. [ToolboxItem(false)]
  16. public partial class ConnectionEditorBase : UserControl
  17. {
  18. /// <summary>
  19. /// Gets or sets a connection string.
  20. /// </summary>
  21. public string ConnectionString
  22. {
  23. get { return GetConnectionString(); }
  24. set { SetConnectionString(value); }
  25. }
  26. /// <summary>
  27. /// This method should construct the connection string from values entered by user.
  28. /// </summary>
  29. /// <returns>The connection string.</returns>
  30. protected virtual string GetConnectionString()
  31. {
  32. return "";
  33. }
  34. /// <summary>
  35. /// This method should parse the connection string and fill the user interface elements.
  36. /// </summary>
  37. /// <param name="value">The connection string.</param>
  38. protected virtual void SetConnectionString(string value)
  39. {
  40. }
  41. /// <summary>
  42. /// Updates the component layout on dpi change.
  43. /// </summary>
  44. public virtual void UpdateDpiDependencies()
  45. {
  46. }
  47. /// <summary>
  48. /// Initializes a new instance of the <see cref="ConnectionEditorBase"/> class with default settings.
  49. /// </summary>
  50. public ConnectionEditorBase()
  51. {
  52. InitializeComponent();
  53. }
  54. }
  55. }