2002-07-19 Tim Coleman <tim@timcoleman.com>
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / MimeTextMatch.cs
1 // \r
2 // System.Web.Services.Description.MimeTextMatch.cs\r
3 //\r
4 // Author:\r
5 //   Tim Coleman (tim@timcoleman.com)\r
6 //\r
7 // Copyright (C) Tim Coleman, 2002\r
8 //\r
9 \r
10 namespace System.Web.Services.Description {\r
11         public sealed class MimeTextMatch : ServiceDescriptionFormatExtension {\r
12 \r
13                 #region Fields\r
14 \r
15                 int capture;\r
16                 int group;\r
17                 bool ignoreCase;\r
18                 MimeTextMatchCollection matches;\r
19                 string name;\r
20                 string pattern;\r
21                 int repeats;\r
22                 string type;\r
23 \r
24                 #endregion // Fields\r
25 \r
26                 #region Constructors\r
27                 \r
28                 public MimeTextMatch ()\r
29                 {\r
30                         capture = 0;\r
31                         group = 1;\r
32                         ignoreCase = false;\r
33                         matches = null;\r
34                         name = String.Empty;\r
35                         pattern = String.Empty;\r
36                         repeats = 1;\r
37                         type = String.Empty;\r
38                 }\r
39                 \r
40                 #endregion // Constructors\r
41 \r
42                 #region Properties\r
43 \r
44                 public int Capture {\r
45                         get { return capture; }\r
46                         set {\r
47                                 if (value < 0)\r
48                                         throw new ArgumentException ();\r
49                                 capture = value; \r
50                         }\r
51                 }\r
52                 \r
53                 public int Group {\r
54                         get { return group; }\r
55                         set {\r
56                                 if (value < 0)\r
57                                         throw new ArgumentException ();\r
58                                 group = value; \r
59                         }\r
60                 }\r
61 \r
62                 public bool IgnoreCase {\r
63                         get { return ignoreCase; }\r
64                         set { ignoreCase = value; }\r
65                 }\r
66 \r
67                 public MimeTextMatchCollection Matches {\r
68                         get { return matches; }\r
69                 }\r
70 \r
71                 public string Name {\r
72                         get { return name; }\r
73                         set { name = value; }\r
74                 }\r
75 \r
76                 public string Pattern {\r
77                         get { return pattern; }\r
78                         set { pattern = value; }\r
79                 }\r
80 \r
81                 public int Repeats {\r
82                         get { return repeats; }\r
83                         set {\r
84                                 if (value < 0)\r
85                                         throw new ArgumentException ();\r
86                                 repeats = value; \r
87                         }\r
88                 }\r
89 \r
90                 public string RepeatsString {\r
91                         get { return Repeats.ToString (); }\r
92                         set { Repeats = Int32.Parse (value); }\r
93                 }\r
94 \r
95                 public string Type {\r
96                         get { return type; }\r
97                         set { type = value; }\r
98                 }\r
99 \r
100                 #endregion // Properties\r
101 \r
102                 #region Methods\r
103 \r
104                 internal void SetParent (MimeTextMatchCollection matches) \r
105                 {\r
106                         this.matches = matches;\r
107                 }\r
108 \r
109                 #endregion // Methods\r
110         }\r
111 }\r