protected override void WriteBeginElement(System.Xml.XmlWriter writer, object obj, ITypeSerializationInfo info)
{
string prefix = info.NamespacePrefix;
if (prefix == null)
{
prefix = writer.LookupPrefix(info.Namespace);
}
else if (writer.LookupPrefix(info.Namespace) == null)
{
writer.WriteAttributeString("xmlns", prefix, null, info.Namespace);
}
string value = prefix + ":" + info.ElementName;
writer.WriteAttributeString(XMLSchemaInstancePrefix, TypeField, XMLSchemaInstanceNamespace, value);
}