SoapSchemaImporter.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. //
  2. // System.Xml.Serialization.SoapSchemaImporter
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. // Lluis Sanchez Gual ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2002
  9. //
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. //
  30. using System.Xml;
  31. using System.CodeDom.Compiler;
  32. namespace System.Xml.Serialization
  33. {
  34. public class SoapSchemaImporter
  35. #if NET_2_0
  36. : SchemaImporter
  37. #endif
  38. {
  39. #region Fields
  40. XmlSchemaImporter _importer;
  41. #endregion
  42. #region Constructors
  43. public SoapSchemaImporter (XmlSchemas schemas)
  44. {
  45. _importer = new XmlSchemaImporter (schemas);
  46. _importer.UseEncodedFormat = true;
  47. }
  48. public SoapSchemaImporter (XmlSchemas schemas, CodeIdentifiers typeIdentifiers)
  49. {
  50. _importer = new XmlSchemaImporter (schemas, typeIdentifiers);
  51. _importer.UseEncodedFormat = true;
  52. }
  53. #if NET_2_0
  54. public SoapSchemaImporter (XmlSchemas schemas, CodeGenerationOptions options, ImportContext context)
  55. {
  56. _importer = new XmlSchemaImporter (schemas, options, context);
  57. _importer.UseEncodedFormat = true;
  58. }
  59. public SoapSchemaImporter (XmlSchemas schemas, CodeIdentifiers typeIdentifiers, CodeGenerationOptions options)
  60. {
  61. _importer = new XmlSchemaImporter (schemas, typeIdentifiers, options);
  62. _importer.UseEncodedFormat = true;
  63. }
  64. public SoapSchemaImporter (XmlSchemas schemas,CodeGenerationOptions options,
  65. CodeDomProvider codeProvider, ImportContext context)
  66. {
  67. _importer = new XmlSchemaImporter (schemas, options, codeProvider, context);
  68. _importer.UseEncodedFormat = true;
  69. }
  70. #endif
  71. #endregion // Constructors
  72. #region Methods
  73. public XmlTypeMapping ImportDerivedTypeMapping (XmlQualifiedName name, Type baseType, bool baseTypeCanBeIndirect)
  74. {
  75. return _importer.ImportDerivedTypeMapping (name, baseType, baseTypeCanBeIndirect);
  76. }
  77. public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember member)
  78. {
  79. return _importer.ImportEncodedMembersMapping (name, ns, member);
  80. }
  81. public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember[] members)
  82. {
  83. return _importer.ImportEncodedMembersMapping (name, ns, members, false);
  84. }
  85. public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember[] members, bool hasWrapperElement)
  86. {
  87. return _importer.ImportEncodedMembersMapping (name, ns, members, hasWrapperElement);
  88. }
  89. [MonoTODO]
  90. public XmlMembersMapping ImportMembersMapping (string name, string ns, SoapSchemaMember[] members, bool hasWrapperElement, Type baseType, bool baseTypeCanBeIndirect)
  91. {
  92. throw new NotImplementedException ();
  93. }
  94. #endregion // Methods
  95. }
  96. }