void AddAttributeFieldMember(CodeTypeDeclaration codeClass, XmlTypeMapMemberAttribute attinfo, string defaultNamespace)
{
CodeTypeMember codeField = CreateFieldMember(codeClass, attinfo);
CodeAttributeDeclarationCollection attributes = codeField.CustomAttributes;
if (attributes == null)
{
attributes = new CodeAttributeDeclarationCollection();
}
GenerateAttributeMember(attributes, attinfo, defaultNamespace, false);
if (attributes.Count > 0)
{
codeField.CustomAttributes = attributes;
}
if (attinfo.MappedType != null)
{
ExportMapCode(attinfo.MappedType, false);
RemoveInclude(attinfo.MappedType);
}
if (attinfo.TypeData.IsValueType && attinfo.IsOptionalValueType)
{
codeField = CreateFieldMember(codeClass, typeof(bool), identifiers.MakeUnique(attinfo.Name + "Specified"));
codeField.Attributes = MemberAttributes.Public;
GenerateSpecifierMember(codeField);
}
}