505758de79212653cf6b46598115a986f5a055d3
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms.RTF / StyleElement.cs
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 // 
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 // 
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
21 //
22 // Authors:
23 //      Peter Bartok    (pbartok@novell.com)
24 //
25 //
26
27 // COMPLETE
28
29 namespace System.Windows.Forms.RTF {
30         internal class StyleElement {
31                 #region Local Variables
32                 private TokenClass      token_class;
33                 private Major           major;
34                 private Minor           minor;
35                 private int             param;
36                 private string          text;
37                 private StyleElement    next;
38                 #endregion Local Variables
39
40                 #region Constructors
41                 public StyleElement(Style s, TokenClass token_class, Major major, Minor minor, int param, string text) {
42                         this.token_class = token_class;
43                         this.major = major;
44                         this.minor = minor;
45                         this.param = param;
46                         this.text = text;
47
48                         lock (s) {
49                                 if (s.Elements == null) {
50                                         s.Elements = this;
51                                 } else {
52                                         StyleElement se = s.Elements;
53                                         while (se.next != null)
54                                                 se = se.next;
55                                         se.next = this;
56                                 }
57                         }
58                 }
59                 #endregion      // Constructors
60
61                 #region Properties
62                 public TokenClass TokenClass {
63                         get {
64                                 return token_class;
65                         }
66
67                         set {
68                                 token_class = value;
69                         }
70                 }
71
72                 public Major Major {
73                         get {
74                                 return major;
75                         }
76
77                         set {
78                                 major = value;
79                         }
80                 }
81
82                 public Minor Minor {
83                         get {
84                                 return minor;
85                         }
86
87                         set {
88                                 minor = value;
89                         }
90                 }
91
92                 public int Param {
93                         get {
94                                 return param;
95                         }
96
97                         set {
98                                 param = value;
99                         }
100                 }
101
102                 public string Text {
103                         get {
104                                 return text;
105                         }
106
107                         set {
108                                 text = value;
109                         }
110                 }
111                 #endregion      // Properties
112
113                 #region Methods
114                 #endregion      // Methods
115         }
116 }