aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/Core/Parse/IfContext.cs
diff options
context:
space:
mode:
authorMW2007-05-26 13:40:19 +0000
committerMW2007-05-26 13:40:19 +0000
commit3436961bb5c01d659d09be134368f4f69460cef9 (patch)
tree3753ba4d7818df2a6bce0bbe863ff033cdfd568a /Prebuild/src/Core/Parse/IfContext.cs
downloadopensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.zip
opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.gz
opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.bz2
opensim-SC_OLD-3436961bb5c01d659d09be134368f4f69460cef9.tar.xz
Start of rewrite 5279!
Diffstat (limited to 'Prebuild/src/Core/Parse/IfContext.cs')
-rw-r--r--Prebuild/src/Core/Parse/IfContext.cs163
1 files changed, 163 insertions, 0 deletions
diff --git a/Prebuild/src/Core/Parse/IfContext.cs b/Prebuild/src/Core/Parse/IfContext.cs
new file mode 100644
index 0000000..383049d
--- /dev/null
+++ b/Prebuild/src/Core/Parse/IfContext.cs
@@ -0,0 +1,163 @@
1#region BSD License
2/*
3Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com)
4
5Redistribution and use in source and binary forms, with or without modification, are permitted
6provided that the following conditions are met:
7
8* Redistributions of source code must retain the above copyright notice, this list of conditions
9 and the following disclaimer.
10* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11 and the following disclaimer in the documentation and/or other materials provided with the
12 distribution.
13* The name of the author may not be used to endorse or promote products derived from this software
14 without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/
24#endregion
25
26#region CVS Information
27/*
28 * $Source$
29 * $Author: jendave $
30 * $Date: 2006-01-28 01:49:58 +0100 (lö, 28 jan 2006) $
31 * $Revision: 71 $
32 */
33#endregion
34
35using System;
36
37namespace Prebuild.Core.Parse
38{
39 /// <summary>
40 ///
41 /// </summary>
42 public enum IfState
43 {
44 /// <summary>
45 ///
46 /// </summary>
47 None,
48 /// <summary>
49 ///
50 /// </summary>
51 If,
52 /// <summary>
53 ///
54 /// </summary>
55 ElseIf,
56 /// <summary>
57 ///
58 /// </summary>
59 Else
60 }
61
62 /// <summary>
63 /// Summary description for IfContext.
64 /// </summary>
65 // Inspired by the equivalent WiX class (see www.sourceforge.net/projects/wix/)
66 public class IfContext
67 {
68 #region Properties
69
70 bool m_Active;
71 bool m_Keep;
72 bool m_EverKept;
73 IfState m_State = IfState.None;
74
75 #endregion
76
77 #region Constructors
78
79 /// <summary>
80 /// Initializes a new instance of the <see cref="IfContext"/> class.
81 /// </summary>
82 /// <param name="active">if set to <c>true</c> [active].</param>
83 /// <param name="keep">if set to <c>true</c> [keep].</param>
84 /// <param name="state">The state.</param>
85 public IfContext(bool active, bool keep, IfState state)
86 {
87 m_Active = active;
88 m_Keep = keep;
89 m_EverKept = keep;
90 m_State = state;
91 }
92
93 #endregion
94
95 #region Properties
96
97 /// <summary>
98 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is active.
99 /// </summary>
100 /// <value><c>true</c> if active; otherwise, <c>false</c>.</value>
101 public bool Active
102 {
103 get
104 {
105 return m_Active;
106 }
107 set
108 {
109 m_Active = value;
110 }
111 }
112
113 /// <summary>
114 /// Gets or sets a value indicating whether this <see cref="IfContext"/> is keep.
115 /// </summary>
116 /// <value><c>true</c> if keep; otherwise, <c>false</c>.</value>
117 public bool Keep
118 {
119 get
120 {
121 return m_Keep;
122 }
123 set
124 {
125 m_Keep = value;
126 if(m_Keep)
127 {
128 m_EverKept = true;
129 }
130 }
131 }
132
133 /// <summary>
134 /// Gets a value indicating whether [ever kept].
135 /// </summary>
136 /// <value><c>true</c> if [ever kept]; otherwise, <c>false</c>.</value>
137 public bool EverKept
138 {
139 get
140 {
141 return m_EverKept;
142 }
143 }
144
145 /// <summary>
146 /// Gets or sets the state.
147 /// </summary>
148 /// <value>The state.</value>
149 public IfState State
150 {
151 get
152 {
153 return m_State;
154 }
155 set
156 {
157 m_State = value;
158 }
159 }
160
161 #endregion
162 }
163}