XmlConnectionStringBuilder.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Data.Common;
  5. namespace FastReport.Data
  6. {
  7. /// <summary>
  8. /// Represents the XmlDataConnection connection string builder.
  9. /// </summary>
  10. /// <remarks>
  11. /// Use this class to parse connection string returned by the <b>XmlDataConnection</b> class.
  12. /// </remarks>
  13. public class XmlConnectionStringBuilder : DbConnectionStringBuilder
  14. {
  15. /// <summary>
  16. /// Gets or sets the path to .xml file.
  17. /// </summary>
  18. public string XmlFile
  19. {
  20. get
  21. {
  22. object xmlFile;
  23. if (TryGetValue("XmlFile", out xmlFile))
  24. return (string)xmlFile;
  25. return "";
  26. }
  27. set
  28. {
  29. base["XmlFile"] = value;
  30. }
  31. }
  32. /// <summary>
  33. /// Gets or sets the path to .xsd file.
  34. /// </summary>
  35. public string XsdFile
  36. {
  37. get
  38. {
  39. object xsdFile;
  40. if (TryGetValue("XsdFile", out xsdFile))
  41. return (string)xsdFile;
  42. return "";
  43. }
  44. set
  45. {
  46. base["XsdFile"] = value;
  47. }
  48. }
  49. /// <summary>
  50. /// Initializes a new instance of the <see cref="XmlConnectionStringBuilder"/> class with default settings.
  51. /// </summary>
  52. public XmlConnectionStringBuilder()
  53. {
  54. ConnectionString = "";
  55. }
  56. /// <summary>
  57. /// Initializes a new instance of the <see cref="XmlConnectionStringBuilder"/> class with
  58. /// specified connection string.
  59. /// </summary>
  60. /// <param name="connectionString">The connection string.</param>
  61. public XmlConnectionStringBuilder(string connectionString) : base()
  62. {
  63. ConnectionString = connectionString;
  64. }
  65. }
  66. }