I want to use an enum in my Custom Configuration Section. So I implemented an enum DatabaseMode and the according property.
I also implemented the according Property in my System.Configuration.ConfigurationElement
. But for the IntelliSense to work in the web.config I need to provide the schema definition (xsd) mirroring the same structure in xsd format.
My question is how the schema is supposed to look to support the enum?
The enum with the different options:
public enum DatabaseMode
{
Development,
Deployment,
Production
}
The property storing the information about the Mode:
[ConfigurationProperty(databaseAlias)]
public DatabaseElement Database
{
get { return (DatabaseElement)this[databaseAlias]; }
set { this[databaseAlias] = value; }
}
Below the important part of my schema file:
<xs:element name="database">
<xs:complexType>
<xs:attribute name="server" type="xs:anyURI" use="required" />
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="user" type="xs:string" use="required" />
<xs:attribute name="password" type="xs:string" use="required" />
</xs:complexType>
</xs:element>