ImportOptions.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.Runtime.Serialization
  5. {
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Reflection;
  9. using System.Security;
  10. using System.Security.Permissions;
  11. using System.CodeDom.Compiler;
  12. public class ImportOptions
  13. {
  14. bool generateSerializable;
  15. bool generateInternal;
  16. bool enableDataBinding;
  17. CodeDomProvider codeProvider;
  18. ICollection<Type> referencedTypes;
  19. ICollection<Type> referencedCollectionTypes;
  20. IDictionary<string, string> namespaces;
  21. bool importXmlType;
  22. IDataContractSurrogate dataContractSurrogate;
  23. public bool GenerateSerializable
  24. {
  25. get { return generateSerializable; }
  26. set { generateSerializable = value; }
  27. }
  28. public bool GenerateInternal
  29. {
  30. get { return generateInternal; }
  31. set { generateInternal = value; }
  32. }
  33. public bool EnableDataBinding
  34. {
  35. get { return enableDataBinding; }
  36. set { enableDataBinding = value; }
  37. }
  38. public CodeDomProvider CodeProvider
  39. {
  40. get { return codeProvider; }
  41. set { codeProvider = value; }
  42. }
  43. public ICollection<Type> ReferencedTypes
  44. {
  45. get
  46. {
  47. if (referencedTypes == null)
  48. {
  49. referencedTypes = new List<Type>();
  50. }
  51. return referencedTypes;
  52. }
  53. }
  54. public ICollection<Type> ReferencedCollectionTypes
  55. {
  56. get
  57. {
  58. if (referencedCollectionTypes == null)
  59. {
  60. referencedCollectionTypes = new List<Type>();
  61. }
  62. return referencedCollectionTypes;
  63. }
  64. }
  65. public IDictionary<String, String> Namespaces
  66. {
  67. get
  68. {
  69. if (namespaces == null)
  70. {
  71. namespaces = new Dictionary<string, string>();
  72. }
  73. return namespaces;
  74. }
  75. }
  76. public bool ImportXmlType
  77. {
  78. get { return importXmlType; }
  79. set { importXmlType = value; }
  80. }
  81. public IDataContractSurrogate DataContractSurrogate
  82. {
  83. get { return dataContractSurrogate; }
  84. set { dataContractSurrogate = value; }
  85. }
  86. }
  87. }