System.Xml.Serialization.XmlCodeExporter.ExportText C# (CSharp) Method

ExportText() public method

public ExportText ( CodeAttributeDeclarationCollection metadata, TypeDesc typeDesc, string dataType ) : void
metadata System.CodeDom.CodeAttributeDeclarationCollection
typeDesc TypeDesc
dataType string
return void
        void ExportText(CodeAttributeDeclarationCollection metadata, TypeDesc typeDesc, string dataType) {
            CodeAttributeDeclaration attribute = new CodeAttributeDeclaration(typeof(XmlTextAttribute).FullName);
            if (typeDesc != null) {
                attribute.Arguments.Add(new CodeAttributeArgument(new CodeTypeOfExpression(typeDesc.FullName)));
            }
            if (dataType != null) {
                attribute.Arguments.Add(new CodeAttributeArgument("DataType", new CodePrimitiveExpression(dataType)));
            }
            metadata.Add(attribute);
        }