internal void Export()
 {
     try
     {
         // Remove this if we decide to publish serialization schema at well-known location
         ExportSerializationSchema();
         foreach (KeyValuePair <XmlQualifiedName, DataContract> pair in _dataContractSet)
         {
             DataContract dataContract = pair.Value;
             if (!_dataContractSet.IsContractProcessed(dataContract))
             {
                 ExportDataContract(dataContract);
                 _dataContractSet.SetContractProcessed(dataContract);
             }
         }
     }
     finally
     {
         _xmlDoc          = null;
         _dataContractSet = null;
     }
 }
        internal DataContractSet(DataContractSet dataContractSet)
        {
            if (dataContractSet == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("dataContractSet"));
            }

            dataContractSurrogate     = dataContractSet.dataContractSurrogate;
            referencedTypes           = dataContractSet.referencedTypes;
            referencedCollectionTypes = dataContractSet.referencedCollectionTypes;

            foreach (KeyValuePair <XmlQualifiedName, DataContract> pair in dataContractSet)
            {
                Add(pair.Key, pair.Value);
            }

            if (dataContractSet.processedContracts != null)
            {
                foreach (KeyValuePair <DataContract, object> pair in dataContractSet.processedContracts)
                {
                    ProcessedContracts.Add(pair.Key, pair.Value);
                }
            }
        }
 internal SchemaExporter(XmlSchemaSet schemas, DataContractSet dataContractSet)
 {
     Schemas          = schemas;
     _dataContractSet = dataContractSet;
 }