private void ExportISerializableDataContract(ClassDataContract dataContract, XmlSchema schema)
{
XmlSchemaComplexType type = new XmlSchemaComplexType();
type.Name = dataContract.StableName.Name;
schema.Items.Add(type);
XmlElement genericInfoElement = null;
if (dataContract.UnderlyingType.IsGenericType)
{
genericInfoElement = ExportGenericInfo(dataContract.UnderlyingType, Globals.GenericTypeLocalName, Globals.SerializationNamespace);
}
XmlElement isValueTypeElement = null;
if (dataContract.BaseContract != null)
{
XmlSchemaComplexContentExtension extension = CreateTypeContent(type, dataContract.BaseContract.StableName, schema);
}
else
{
schema.Namespaces.Add(Globals.SerPrefixForSchema, Globals.SerializationNamespace);
type.Particle = ISerializableSequence;
XmlSchemaAttribute iSerializableFactoryTypeAttribute = ISerializableFactoryTypeAttribute;
type.Attributes.Add(iSerializableFactoryTypeAttribute);
SchemaHelper.AddSchemaImport(ISerializableFactoryTypeAttribute.RefName.Namespace, schema);
if (dataContract.IsValueType)
{
isValueTypeElement = GetAnnotationMarkup(IsValueTypeName, XmlConvert.ToString(dataContract.IsValueType), schema);
}
}
type.Annotation = GetSchemaAnnotation(genericInfoElement, ExportSurrogateData(dataContract), isValueTypeElement);
}