| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- // Author: Dwivedi, Ajay kumar
- // [email protected]
- using System;
- using System.Xml;
- using System.ComponentModel;
- using System.Xml.Serialization;
- namespace System.Xml.Schema
- {
- /// <summary>
- /// Summary description for XmlSchemaAttribute.
- /// </summary>
- public class XmlSchemaAttribute : XmlSchemaAnnotated
- {
- private object attributeType;
- private string defaultValue;
- private string fixedValue;
- private XmlSchemaForm form;
- private string name;
- private XmlQualifiedName qualifiedName;
- private XmlQualifiedName refName;
- private XmlSchemaSimpleType schemaType;
- private XmlQualifiedName schemaTypeName;
- private XmlSchemaUse use;
- public XmlSchemaAttribute()
- {
- //FIXME: Docs says the default is optional.
- //Whereas the MS implementation has default None.
- use = XmlSchemaUse.None;
- qualifiedName = XmlQualifiedName.Empty;
- refName = XmlQualifiedName.Empty;
- }
- // Properties
- [XmlIgnore]
- public object AttributeType
- { //FIXME: This is not correct. Is it?
- get{ return attributeType; }
- }
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("default")]
- public string DefaultValue
- {
- get{ return defaultValue;}
- set
- { // Default Value and fixed Value are mutually exclusive
- fixedValue = null;
- defaultValue = value;
- }
- }
- [DefaultValue(null)]
- [System.Xml.Serialization.XmlAttribute("fixed")]
- public string FixedValue
- {
- get{ return fixedValue;}
- set
- { // Default Value and fixed Value are mutually exclusive
- defaultValue = null;
- fixedValue = value;
- }
- }
- [DefaultValue(XmlSchemaForm.None)]
- [System.Xml.Serialization.XmlAttribute("form")]
- public XmlSchemaForm Form
- {
- get{ return form;}
- set{ form = value;}
- }
- [System.Xml.Serialization.XmlAttribute("name")]
- public string Name
- {
- get{ return name;}
- set
- { // Name and RefName are mutually exclusive
- refName = null;
- name = value;
- }
- }
- [XmlIgnore]
- public XmlQualifiedName QualifiedName
- {
- get{ return qualifiedName;}
- }
- [System.Xml.Serialization.XmlAttribute("ref")]
- public XmlQualifiedName RefName
- {
- get{ return refName;}
- set
- { // Name and RefName are mutually exclusive
- name = null;
- refName = value;
- }
- }
- [XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
- public XmlSchemaSimpleType SchemaType
- {
- get{ return schemaType;}
- set{ schemaType = value;}
- }
-
- [System.Xml.Serialization.XmlAttribute("type")]
- public XmlQualifiedName SchemaTypeName
- {
- get{ return schemaTypeName;}
- set{ schemaTypeName = value;}
- }
- [DefaultValue(XmlSchemaUse.None)]
- [System.Xml.Serialization.XmlAttribute("use")]
- public XmlSchemaUse Use
- {
- get{ return use;}
- set{ use = value;}
- }
- }
- }
|