XsdDataContractExporter.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Reflection;
  5. using System.Xml;
  6. using System.Xml.Schema;
  7. using QName = System.Xml.XmlQualifiedName;
  8. namespace System.Runtime.Serialization
  9. {
  10. public class XsdDataContractExporter
  11. {
  12. ExportOptions options;
  13. XmlSchemaSet schemas;
  14. public XsdDataContractExporter ()
  15. {
  16. }
  17. public XsdDataContractExporter (XmlSchemaSet schemas)
  18. {
  19. this.schemas = schemas;
  20. }
  21. public XmlSchemaSet Schemas {
  22. get { return schemas; }
  23. }
  24. public ExportOptions Options {
  25. get { return options; }
  26. set { options = value; }
  27. }
  28. public bool CanExport (IList<Type> types)
  29. {
  30. foreach (Type t in types)
  31. if (!CanExport (t))
  32. return false;
  33. return true;
  34. }
  35. public bool CanExport (IList<Assembly> assemblies)
  36. {
  37. foreach (Assembly a in assemblies)
  38. foreach (Module m in a.GetModules ())
  39. foreach (Type t in m.GetTypes ())
  40. if (!CanExport (t))
  41. return false;
  42. return true;
  43. }
  44. public bool CanExport (Type type)
  45. {
  46. throw new NotImplementedException ();
  47. }
  48. public void Export (IList<Type> types)
  49. {
  50. foreach (Type t in types)
  51. Export (t);
  52. }
  53. public void Export (IList<Assembly> assemblies)
  54. {
  55. foreach (Assembly a in assemblies)
  56. foreach (Module m in a.GetModules ())
  57. foreach (Type t in m.GetTypes ())
  58. Export (t);
  59. }
  60. public void Export (Type type)
  61. {
  62. throw new NotImplementedException ();
  63. }
  64. public static XmlQualifiedName GetRootElementName (Type type)
  65. {
  66. throw new NotImplementedException ();
  67. }
  68. public static XmlQualifiedName GetSchemaTypeName (Type type)
  69. {
  70. throw new NotImplementedException ();
  71. }
  72. }
  73. }