2004-05-06 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaFacet.cs
1 // Author: Dwivedi, Ajay kumar\r
2 //            Adwiv@Yahoo.com\r
3 using System;\r
4 using System.Xml;\r
5 using System.Xml.Serialization;\r
6 using System.ComponentModel;\r
7 \r
8 namespace System.Xml.Schema\r
9 {\r
10                         \r
11         /// <summary>\r
12         /// Summary description for XmlSchemaFacet.\r
13         /// </summary>\r
14         public abstract class XmlSchemaFacet : XmlSchemaAnnotated\r
15         {\r
16                 [Flags]\r
17                 internal protected enum Facet {\r
18                         None = 0,\r
19                         length = 1 ,\r
20                         minLength = 2,\r
21                         maxLength = 4,\r
22                         pattern = 8,\r
23                         enumeration = 16,\r
24                         whiteSpace = 32,\r
25                         maxInclusive = 64,\r
26                         maxExclusive = 128,\r
27                         minExclusive = 256,\r
28                         minInclusive = 512, \r
29                         totalDigits = 1024,\r
30                         fractionDigits = 2048\r
31                 };\r
32  \r
33                 internal protected const Facet AllFacets = \r
34                                         Facet.length | Facet.minLength |  Facet.maxLength |\r
35                                         Facet.minExclusive | Facet.maxExclusive |\r
36                                         Facet.minInclusive | Facet.maxInclusive |\r
37                                         Facet.pattern | Facet.enumeration | Facet.whiteSpace |\r
38                                         Facet.totalDigits | Facet.fractionDigits;\r
39                 \r
40                 internal abstract Facet ThisFacet { get ; }\r
41                 \r
42                 private bool isFixed;\r
43                 private string val;\r
44 \r
45                 protected XmlSchemaFacet()\r
46                 {\r
47                 }\r
48                 \r
49                 [System.Xml.Serialization.XmlAttribute("value")]\r
50                 public string Value\r
51                 {\r
52                         get{ return  val; } \r
53                         set{ val = value; }\r
54                 }\r
55 \r
56                 [DefaultValue(false)]\r
57                 [System.Xml.Serialization.XmlAttribute("fixed")]\r
58                 public virtual bool IsFixed \r
59                 {\r
60                         get{ return  isFixed; }\r
61                         set{ isFixed = value; }\r
62                 }\r
63         }\r
64 }\r