Auto status change to "Under Review"
@@ -1,335 +1,343 | |||
|
1 | 1 | using Implab; |
|
2 | 2 | using System; |
|
3 | 3 | using System.Collections.Generic; |
|
4 | 4 | using System.Globalization; |
|
5 | 5 | using System.IO; |
|
6 | 6 | using System.Xml; |
|
7 | 7 | |
|
8 | 8 | namespace Implab.Formats.JSON { |
|
9 | 9 | public class JSONXmlReader : XmlReader { |
|
10 | 10 | |
|
11 | 11 | enum ValueContext { |
|
12 | 12 | Undefined, |
|
13 | 13 | ElementStart, |
|
14 | 14 | ElementValue, |
|
15 | 15 | ElementEnd, |
|
16 | 16 | ElementEmpty |
|
17 | 17 | } |
|
18 | 18 | |
|
19 | 19 | struct LocalNameContext { |
|
20 | 20 | public string localName; |
|
21 | 21 | public bool isArray; |
|
22 | 22 | } |
|
23 | 23 | |
|
24 | 24 | JSONParser m_parser; |
|
25 | 25 | ValueContext m_valueContext; |
|
26 | 26 | ReadState m_state = ReadState.Initial; |
|
27 | 27 | Stack<LocalNameContext> m_localNameStack = new Stack<LocalNameContext>(); |
|
28 | 28 | LocalNameContext m_localName; |
|
29 | 29 | int m_depthCorrection; |
|
30 | 30 | |
|
31 | 31 | readonly string m_rootName; |
|
32 | 32 | readonly string m_prefix; |
|
33 | 33 | readonly string m_namespaceUri; |
|
34 | 34 | readonly bool m_flattenArrays; |
|
35 | 35 | readonly string m_arrayItemName; |
|
36 | 36 | readonly XmlNameTable m_nameTable; |
|
37 | 37 | |
|
38 | 38 | JSONXmlReader(JSONParser parser, JSONXmlReaderOptions options) { |
|
39 | 39 | m_parser = parser; |
|
40 | 40 | |
|
41 | 41 | if (options != null) { |
|
42 | 42 | m_prefix = options.NodesPrefix ?? String.Empty; |
|
43 | 43 | m_namespaceUri = options.NamespaceURI ?? String.Empty; |
|
44 | 44 | m_rootName = options.RootName ?? "json"; |
|
45 | 45 | m_flattenArrays = options.FlattenArrays; |
|
46 | 46 | m_arrayItemName = options.ArrayItemName ?? "item"; |
|
47 | 47 | m_nameTable = options.NameTable ?? new NameTable(); |
|
48 | 48 | } else { |
|
49 | 49 | m_prefix = String.Empty; |
|
50 | 50 | m_namespaceUri = String.Empty; |
|
51 | 51 | m_rootName = "json"; |
|
52 | 52 | m_flattenArrays = false; |
|
53 | 53 | m_arrayItemName = "item"; |
|
54 | 54 | m_nameTable = new NameTable(); |
|
55 | 55 | } |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | /// <summary> |
|
59 | 59 | /// Always 0, JSON doesn't support attributes |
|
60 | 60 | /// </summary> |
|
61 | 61 | public override int AttributeCount { |
|
62 | 62 | get { return 0; } |
|
63 | 63 | } |
|
64 | 64 | |
|
65 | 65 | public override string BaseURI { |
|
66 | 66 | get { return String.Empty; } |
|
67 | 67 | } |
|
68 | 68 | |
|
69 | 69 | public override int Depth { |
|
70 | 70 | get { |
|
71 | 71 | return m_localNameStack.Count + m_depthCorrection; |
|
72 | 72 | } |
|
73 | 73 | } |
|
74 | 74 | |
|
75 | 75 | public override bool EOF { |
|
76 | 76 | get { return m_parser.EOF; } |
|
77 | 77 | } |
|
78 | 78 | |
|
79 | 79 | /// <summary> |
|
80 | 80 | /// Always throws an exception |
|
81 | 81 | /// </summary> |
|
82 | 82 | /// <param name="i"></param> |
|
83 | 83 | /// <returns></returns> |
|
84 | 84 | public override string GetAttribute(int i) { |
|
85 | 85 | throw new ArgumentOutOfRangeException(); |
|
86 | 86 | } |
|
87 | 87 | |
|
88 | 88 | /// <summary> |
|
89 | 89 | /// Always returns empty string |
|
90 | 90 | /// </summary> |
|
91 | 91 | /// <param name="name"></param> |
|
92 | 92 | /// <param name="namespaceURI"></param> |
|
93 | 93 | /// <returns></returns> |
|
94 | 94 | public override string GetAttribute(string name, string namespaceURI) { |
|
95 | 95 | return String.Empty; |
|
96 | 96 | } |
|
97 | 97 | |
|
98 | 98 | /// <summary> |
|
99 | 99 | /// Always returns empty string |
|
100 | 100 | /// </summary> |
|
101 | 101 | /// <param name="name"></param> |
|
102 | 102 | /// <returns></returns> |
|
103 | 103 | public override string GetAttribute(string name) { |
|
104 | 104 | return String.Empty; |
|
105 | 105 | } |
|
106 | 106 | |
|
107 | 107 | public override bool IsEmptyElement { |
|
108 | 108 | get { return m_parser.ElementType == JSONElementType.Value && m_valueContext == ValueContext.ElementEmpty; } |
|
109 | 109 | } |
|
110 | 110 | |
|
111 | 111 | public override string LocalName { |
|
112 | 112 | get { return m_localName.localName; } |
|
113 | 113 | } |
|
114 | 114 | |
|
115 | 115 | public override string LookupNamespace(string prefix) { |
|
116 | 116 | if (String.IsNullOrEmpty(prefix) || prefix == m_prefix) |
|
117 | 117 | return m_namespaceUri; |
|
118 | 118 | |
|
119 | 119 | return String.Empty; |
|
120 | 120 | } |
|
121 | 121 | |
|
122 | 122 | public override bool MoveToAttribute(string name, string ns) { |
|
123 | 123 | return false; |
|
124 | 124 | } |
|
125 | 125 | |
|
126 | 126 | public override bool MoveToAttribute(string name) { |
|
127 | 127 | return false; |
|
128 | 128 | } |
|
129 | 129 | |
|
130 | 130 | public override bool MoveToElement() { |
|
131 | 131 | return false; |
|
132 | 132 | } |
|
133 | 133 | |
|
134 | 134 | public override bool MoveToFirstAttribute() { |
|
135 | 135 | return false; |
|
136 | 136 | } |
|
137 | 137 | |
|
138 | 138 | public override bool MoveToNextAttribute() { |
|
139 | 139 | return false; |
|
140 | 140 | } |
|
141 | 141 | |
|
142 | 142 | public override XmlNameTable NameTable { |
|
143 | 143 | get { return m_nameTable; } |
|
144 | 144 | } |
|
145 | 145 | |
|
146 | 146 | public override string NamespaceURI { |
|
147 | 147 | get { return m_namespaceUri; } |
|
148 | 148 | } |
|
149 | 149 | |
|
150 | 150 | public override XmlNodeType NodeType { |
|
151 | 151 | get { |
|
152 | 152 | switch (m_parser.ElementType) { |
|
153 | 153 | case JSONElementType.BeginObject: |
|
154 | 154 | case JSONElementType.BeginArray: |
|
155 | 155 | return XmlNodeType.Element; |
|
156 | 156 | case JSONElementType.EndObject: |
|
157 | 157 | case JSONElementType.EndArray: |
|
158 | 158 | return XmlNodeType.EndElement; |
|
159 | 159 | case JSONElementType.Value: |
|
160 | 160 | switch (m_valueContext) { |
|
161 | 161 | case ValueContext.ElementStart: |
|
162 | 162 | case ValueContext.ElementEmpty: |
|
163 | 163 | return XmlNodeType.Element; |
|
164 | 164 | case ValueContext.ElementValue: |
|
165 | 165 | return XmlNodeType.Text; |
|
166 | 166 | case ValueContext.ElementEnd: |
|
167 | 167 | return XmlNodeType.EndElement; |
|
168 | 168 | default: |
|
169 | 169 | throw new InvalidOperationException(); |
|
170 | 170 | } |
|
171 | 171 | default: |
|
172 | 172 | throw new InvalidOperationException(); |
|
173 | 173 | } |
|
174 | 174 | } |
|
175 | 175 | } |
|
176 | 176 | |
|
177 | 177 | public override string Prefix { |
|
178 | 178 | get { return m_prefix; } |
|
179 | 179 | } |
|
180 | 180 | |
|
181 | 181 | public override bool Read() { |
|
182 | 182 | if (m_state != ReadState.Interactive && m_state != ReadState.Initial) |
|
183 | 183 | return false; |
|
184 | 184 | |
|
185 | 185 | if (m_state == ReadState.Initial) |
|
186 | 186 | m_state = ReadState.Interactive; |
|
187 | 187 | |
|
188 | 188 | try { |
|
189 | 189 | switch (m_parser.ElementType) { |
|
190 | 190 | case JSONElementType.Value: |
|
191 | 191 | switch (m_valueContext) { |
|
192 | 192 | case ValueContext.ElementStart: |
|
193 | 193 | SetLocalName(String.Empty); |
|
194 | 194 | m_valueContext = ValueContext.ElementValue; |
|
195 | 195 | return true; |
|
196 | 196 | case ValueContext.ElementValue: |
|
197 | 197 | RestoreLocalName(); |
|
198 | 198 | m_valueContext = ValueContext.ElementEnd; |
|
199 | 199 | return true; |
|
200 | 200 | case ValueContext.ElementEmpty: |
|
201 | 201 | case ValueContext.ElementEnd: |
|
202 | 202 | RestoreLocalName(); |
|
203 | 203 | break; |
|
204 | 204 | } |
|
205 | 205 | break; |
|
206 | 206 | case JSONElementType.EndArray: |
|
207 | 207 | case JSONElementType.EndObject: |
|
208 | 208 | RestoreLocalName(); |
|
209 | 209 | break; |
|
210 | 210 | } |
|
211 | 211 | string itemName = m_parser.ElementType == JSONElementType.None ? m_rootName : m_flattenArrays ? m_localName.localName : m_arrayItemName; |
|
212 | 212 | while (m_parser.Read()) { |
|
213 | 213 | if (!String.IsNullOrEmpty(m_parser.ElementName)) |
|
214 | 214 | itemName = m_parser.ElementName; |
|
215 | 215 | |
|
216 | 216 | switch (m_parser.ElementType) { |
|
217 | 217 | case JSONElementType.BeginArray: |
|
218 | 218 | if (m_flattenArrays && !m_localName.isArray) { |
|
219 | 219 | m_depthCorrection--; |
|
220 | 220 | SetLocalName(itemName, true); |
|
221 | 221 | continue; |
|
222 | 222 | } |
|
223 | 223 | SetLocalName(itemName, true); |
|
224 | 224 | break; |
|
225 | 225 | case JSONElementType.BeginObject: |
|
226 | 226 | SetLocalName(itemName); |
|
227 | 227 | break; |
|
228 | 228 | case JSONElementType.EndArray: |
|
229 | 229 | if (m_flattenArrays && !m_localNameStack.Peek().isArray) { |
|
230 | 230 | RestoreLocalName(); |
|
231 | 231 | m_depthCorrection++; |
|
232 | 232 | continue; |
|
233 | 233 | } |
|
234 | 234 | break; |
|
235 | 235 | case JSONElementType.EndObject: |
|
236 | 236 | break; |
|
237 | 237 | case JSONElementType.Value: |
|
238 | 238 | SetLocalName(itemName); |
|
239 | 239 | m_valueContext = m_parser.ElementValue == null ? ValueContext.ElementEmpty : ValueContext.ElementStart; |
|
240 | 240 | break; |
|
241 | 241 | } |
|
242 | 242 | return true; |
|
243 | 243 | } |
|
244 | 244 | |
|
245 | 245 | m_state = ReadState.EndOfFile; |
|
246 | 246 | return false; |
|
247 | 247 | } catch { |
|
248 | 248 | m_state = ReadState.Error; |
|
249 | 249 | throw; |
|
250 | 250 | } |
|
251 | 251 | } |
|
252 | 252 | |
|
253 | 253 | public override bool ReadAttributeValue() { |
|
254 | 254 | return false; |
|
255 | 255 | } |
|
256 | 256 | |
|
257 | 257 | public override ReadState ReadState { |
|
258 | 258 | get { return m_state; } |
|
259 | 259 | } |
|
260 | 260 | |
|
261 | 261 | public override void ResolveEntity() { |
|
262 | 262 | // do nothing |
|
263 | 263 | } |
|
264 | 264 | |
|
265 | 265 | public override string Value { |
|
266 | 266 | get { |
|
267 | 267 | if (m_parser.ElementValue == null) |
|
268 | 268 | return String.Empty; |
|
269 | if (Convert.GetTypeCode(m_parser.ElementValue) == TypeCode.Double) | |
|
270 | return ((double)m_parser.ElementValue).ToString(CultureInfo.InvariantCulture); | |
|
271 | return m_parser.ElementValue.ToString(); | |
|
269 | ||
|
270 | switch(Convert.GetTypeCode (m_parser.ElementValue)) { | |
|
271 | case TypeCode.Double: | |
|
272 | return ((double)m_parser.ElementValue).ToString (CultureInfo.InvariantCulture); | |
|
273 | case TypeCode.String: | |
|
274 | return (string)m_parser.ElementValue; | |
|
275 | case TypeCode.Boolean: | |
|
276 | return (bool)m_parser.ElementValue ? "true" : "false"; | |
|
277 | default: | |
|
278 | return m_parser.ElementValue.ToString (); | |
|
279 | } | |
|
272 | 280 | } |
|
273 | 281 | } |
|
274 | 282 | |
|
275 | 283 | void SetLocalName(string name) { |
|
276 | 284 | m_localNameStack.Push(m_localName); |
|
277 | 285 | m_localName.localName = name; |
|
278 | 286 | m_localName.isArray = false; |
|
279 | 287 | } |
|
280 | 288 | |
|
281 | 289 | void SetLocalName(string name, bool isArray) { |
|
282 | 290 | m_localNameStack.Push(m_localName); |
|
283 | 291 | m_localName.localName = name; |
|
284 | 292 | m_localName.isArray = isArray; |
|
285 | 293 | } |
|
286 | 294 | |
|
287 | 295 | void RestoreLocalName() { |
|
288 | 296 | m_localName = m_localNameStack.Pop(); |
|
289 | 297 | } |
|
290 | 298 | |
|
291 | 299 | public override void Close() { |
|
292 | 300 | |
|
293 | 301 | } |
|
294 | 302 | |
|
295 | 303 | protected override void Dispose(bool disposing) { |
|
296 | 304 | #if MONO |
|
297 | 305 | disposing = true; |
|
298 | 306 | #endif |
|
299 | 307 | if (disposing) { |
|
300 | 308 | m_parser.Dispose(); |
|
301 | 309 | } |
|
302 | 310 | base.Dispose(disposing); |
|
303 | 311 | } |
|
304 | 312 | |
|
305 | 313 | public static JSONXmlReader Create(string file, JSONXmlReaderOptions options) { |
|
306 | 314 | return Create(File.OpenText(file), options); |
|
307 | 315 | } |
|
308 | 316 | |
|
309 | 317 | /// <summary> |
|
310 | 318 | /// Creates the XmlReader for the specified text stream with JSON data. |
|
311 | 319 | /// </summary> |
|
312 | 320 | /// <param name="reader">Text reader.</param> |
|
313 | 321 | /// <param name="options">Options.</param> |
|
314 | 322 | /// <remarks> |
|
315 | 323 | /// The reader will be disposed when the XmlReader is disposed. |
|
316 | 324 | /// </remarks> |
|
317 | 325 | public static JSONXmlReader Create(TextReader reader, JSONXmlReaderOptions options) { |
|
318 | 326 | return new JSONXmlReader(new JSONParser(reader), options); |
|
319 | 327 | } |
|
320 | 328 | |
|
321 | 329 | /// <summary> |
|
322 | 330 | /// Creates the XmlReader for the specified stream with JSON data. |
|
323 | 331 | /// </summary> |
|
324 | 332 | /// <param name="stream">Stream.</param> |
|
325 | 333 | /// <param name="options">Options.</param> |
|
326 | 334 | /// <remarks> |
|
327 | 335 | /// The stream will be disposed when the XmlReader is disposed. |
|
328 | 336 | /// </remarks> |
|
329 | 337 | public static JSONXmlReader Create(Stream stream, JSONXmlReaderOptions options) { |
|
330 | 338 | Safe.ArgumentNotNull(stream, "stream"); |
|
331 | 339 | // HACK don't dispose StreaReader to keep stream opened |
|
332 | 340 | return Create(new StreamReader(stream), options); |
|
333 | 341 | } |
|
334 | 342 | } |
|
335 | 343 | } |
@@ -1,274 +1,276 | |||
|
1 | 1 | ο»Ώ<?xml version="1.0" encoding="utf-8"?> |
|
2 | 2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 | 3 | <PropertyGroup> |
|
4 | 4 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
5 | 5 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
6 | 6 | <ProjectGuid>{F550F1F8-8746-4AD0-9614-855F4C4B7F05}</ProjectGuid> |
|
7 | 7 | <OutputType>Library</OutputType> |
|
8 | 8 | <RootNamespace>Implab</RootNamespace> |
|
9 | 9 | <AssemblyName>Implab</AssemblyName> |
|
10 | 10 | <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|
11 | 11 | </PropertyGroup> |
|
12 | 12 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
13 | 13 | <DebugSymbols>true</DebugSymbols> |
|
14 | 14 | <DebugType>full</DebugType> |
|
15 | 15 | <Optimize>false</Optimize> |
|
16 | 16 | <OutputPath>bin\Debug</OutputPath> |
|
17 | 17 | <DefineConstants>TRACE;DEBUG;</DefineConstants> |
|
18 | 18 | <ErrorReport>prompt</ErrorReport> |
|
19 | 19 | <WarningLevel>4</WarningLevel> |
|
20 | 20 | <ConsolePause>false</ConsolePause> |
|
21 | 21 | <RunCodeAnalysis>true</RunCodeAnalysis> |
|
22 | 22 | </PropertyGroup> |
|
23 | 23 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
24 | 24 | <DebugType>full</DebugType> |
|
25 | 25 | <Optimize>true</Optimize> |
|
26 | 26 | <OutputPath>bin\Release</OutputPath> |
|
27 | 27 | <ErrorReport>prompt</ErrorReport> |
|
28 | 28 | <WarningLevel>4</WarningLevel> |
|
29 | 29 | <ConsolePause>false</ConsolePause> |
|
30 | 30 | </PropertyGroup> |
|
31 | 31 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug 4.5|AnyCPU' "> |
|
32 | 32 | <DebugSymbols>true</DebugSymbols> |
|
33 | 33 | <DebugType>full</DebugType> |
|
34 | 34 | <Optimize>false</Optimize> |
|
35 | 35 | <OutputPath>bin\Debug</OutputPath> |
|
36 | 36 | <DefineConstants>TRACE;DEBUG;NET_4_5</DefineConstants> |
|
37 | 37 | <ErrorReport>prompt</ErrorReport> |
|
38 | 38 | <WarningLevel>4</WarningLevel> |
|
39 | 39 | <RunCodeAnalysis>true</RunCodeAnalysis> |
|
40 | 40 | <ConsolePause>false</ConsolePause> |
|
41 | 41 | </PropertyGroup> |
|
42 | 42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release 4.5|AnyCPU' "> |
|
43 | 43 | <Optimize>true</Optimize> |
|
44 | 44 | <OutputPath>bin\Release</OutputPath> |
|
45 | 45 | <ErrorReport>prompt</ErrorReport> |
|
46 | 46 | <WarningLevel>4</WarningLevel> |
|
47 | 47 | <ConsolePause>false</ConsolePause> |
|
48 | 48 | <DefineConstants>NET_4_5</DefineConstants> |
|
49 | 49 | </PropertyGroup> |
|
50 | 50 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugMono|AnyCPU' "> |
|
51 | 51 | <DebugSymbols>true</DebugSymbols> |
|
52 | 52 | <DebugType>full</DebugType> |
|
53 | 53 | <Optimize>false</Optimize> |
|
54 | 54 | <OutputPath>bin\Debug</OutputPath> |
|
55 | 55 | <DefineConstants>TRACE;DEBUG;NET_4_5;MONO</DefineConstants> |
|
56 | 56 | <ErrorReport>prompt</ErrorReport> |
|
57 | 57 | <WarningLevel>4</WarningLevel> |
|
58 | 58 | <RunCodeAnalysis>true</RunCodeAnalysis> |
|
59 | 59 | <ConsolePause>false</ConsolePause> |
|
60 | 60 | </PropertyGroup> |
|
61 | 61 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMono|AnyCPU' "> |
|
62 | 62 | <Optimize>true</Optimize> |
|
63 | 63 | <OutputPath>bin\Release</OutputPath> |
|
64 | 64 | <DefineConstants>NET_4_5;MONO;</DefineConstants> |
|
65 | 65 | <ErrorReport>prompt</ErrorReport> |
|
66 | 66 | <WarningLevel>4</WarningLevel> |
|
67 | 67 | <ConsolePause>false</ConsolePause> |
|
68 | 68 | </PropertyGroup> |
|
69 | 69 | <ItemGroup> |
|
70 | 70 | <Reference Include="System" /> |
|
71 | 71 | <Reference Include="System.Xml" /> |
|
72 | 72 | <Reference Include="mscorlib" /> |
|
73 | 73 | </ItemGroup> |
|
74 | 74 | <ItemGroup> |
|
75 | 75 | <Compile Include="Components\StateChangeEventArgs.cs" /> |
|
76 | 76 | <Compile Include="CustomEqualityComparer.cs" /> |
|
77 | 77 | <Compile Include="Diagnostics\ConsoleTraceListener.cs" /> |
|
78 | 78 | <Compile Include="Diagnostics\LogChannel.cs" /> |
|
79 | 79 | <Compile Include="Diagnostics\LogicalOperation.cs" /> |
|
80 | 80 | <Compile Include="Diagnostics\TextFileListener.cs" /> |
|
81 | 81 | <Compile Include="Diagnostics\Trace.cs" /> |
|
82 | 82 | <Compile Include="Diagnostics\TraceLog.cs" /> |
|
83 | 83 | <Compile Include="Diagnostics\TraceEvent.cs" /> |
|
84 | 84 | <Compile Include="Diagnostics\TraceEventType.cs" /> |
|
85 | 85 | <Compile Include="Diagnostics\TraceSourceAttribute.cs" /> |
|
86 | 86 | <Compile Include="ICancellable.cs" /> |
|
87 | 87 | <Compile Include="IProgressHandler.cs" /> |
|
88 | 88 | <Compile Include="IProgressNotifier.cs" /> |
|
89 | 89 | <Compile Include="IPromiseT.cs" /> |
|
90 | 90 | <Compile Include="IPromise.cs" /> |
|
91 | 91 | <Compile Include="IServiceLocator.cs" /> |
|
92 | 92 | <Compile Include="ITaskController.cs" /> |
|
93 | 93 | <Compile Include="Parallels\DispatchPool.cs" /> |
|
94 | 94 | <Compile Include="Parallels\ArrayTraits.cs" /> |
|
95 | 95 | <Compile Include="Parallels\MTQueue.cs" /> |
|
96 | 96 | <Compile Include="Parallels\WorkerPool.cs" /> |
|
97 | 97 | <Compile Include="ProgressInitEventArgs.cs" /> |
|
98 | 98 | <Compile Include="Properties\AssemblyInfo.cs" /> |
|
99 | 99 | <Compile Include="Parallels\AsyncPool.cs" /> |
|
100 | 100 | <Compile Include="Safe.cs" /> |
|
101 | 101 | <Compile Include="SyncContextPromise.cs" /> |
|
102 | 102 | <Compile Include="ValueEventArgs.cs" /> |
|
103 | 103 | <Compile Include="PromiseExtensions.cs" /> |
|
104 | 104 | <Compile Include="SyncContextPromiseT.cs" /> |
|
105 | 105 | <Compile Include="Diagnostics\OperationContext.cs" /> |
|
106 | 106 | <Compile Include="Diagnostics\TraceContext.cs" /> |
|
107 | 107 | <Compile Include="Diagnostics\LogEventArgs.cs" /> |
|
108 | 108 | <Compile Include="Diagnostics\LogEventArgsT.cs" /> |
|
109 | 109 | <Compile Include="Diagnostics\Extensions.cs" /> |
|
110 | 110 | <Compile Include="PromiseEventType.cs" /> |
|
111 | 111 | <Compile Include="Parallels\AsyncQueue.cs" /> |
|
112 | 112 | <Compile Include="PromiseT.cs" /> |
|
113 | 113 | <Compile Include="IDeferred.cs" /> |
|
114 | 114 | <Compile Include="IDeferredT.cs" /> |
|
115 | 115 | <Compile Include="Promise.cs" /> |
|
116 | 116 | <Compile Include="PromiseTransientException.cs" /> |
|
117 | 117 | <Compile Include="Parallels\Signal.cs" /> |
|
118 | 118 | <Compile Include="Parallels\SharedLock.cs" /> |
|
119 | 119 | <Compile Include="Diagnostics\ILogWriter.cs" /> |
|
120 | 120 | <Compile Include="Diagnostics\ListenerBase.cs" /> |
|
121 | 121 | <Compile Include="Parallels\BlockingQueue.cs" /> |
|
122 | 122 | <Compile Include="AbstractEvent.cs" /> |
|
123 | 123 | <Compile Include="AbstractPromise.cs" /> |
|
124 | 124 | <Compile Include="AbstractPromiseT.cs" /> |
|
125 | 125 | <Compile Include="FuncTask.cs" /> |
|
126 | 126 | <Compile Include="FuncTaskBase.cs" /> |
|
127 | 127 | <Compile Include="FuncTaskT.cs" /> |
|
128 | 128 | <Compile Include="ActionChainTaskBase.cs" /> |
|
129 | 129 | <Compile Include="ActionChainTask.cs" /> |
|
130 | 130 | <Compile Include="ActionChainTaskT.cs" /> |
|
131 | 131 | <Compile Include="FuncChainTaskBase.cs" /> |
|
132 | 132 | <Compile Include="FuncChainTask.cs" /> |
|
133 | 133 | <Compile Include="FuncChainTaskT.cs" /> |
|
134 | 134 | <Compile Include="ActionTaskBase.cs" /> |
|
135 | 135 | <Compile Include="ActionTask.cs" /> |
|
136 | 136 | <Compile Include="ActionTaskT.cs" /> |
|
137 | 137 | <Compile Include="ICancellationToken.cs" /> |
|
138 | 138 | <Compile Include="SuccessPromise.cs" /> |
|
139 | 139 | <Compile Include="SuccessPromiseT.cs" /> |
|
140 | 140 | <Compile Include="PromiseAwaiterT.cs" /> |
|
141 | 141 | <Compile Include="PromiseAwaiter.cs" /> |
|
142 | 142 | <Compile Include="Components\ComponentContainer.cs" /> |
|
143 | 143 | <Compile Include="Components\Disposable.cs" /> |
|
144 | 144 | <Compile Include="Components\DisposablePool.cs" /> |
|
145 | 145 | <Compile Include="Components\ObjectPool.cs" /> |
|
146 | 146 | <Compile Include="Components\ServiceLocator.cs" /> |
|
147 | 147 | <Compile Include="Components\IInitializable.cs" /> |
|
148 | 148 | <Compile Include="TaskController.cs" /> |
|
149 | 149 | <Compile Include="Components\App.cs" /> |
|
150 | 150 | <Compile Include="Components\IRunnable.cs" /> |
|
151 | 151 | <Compile Include="Components\ExecutionState.cs" /> |
|
152 | 152 | <Compile Include="Components\RunnableComponent.cs" /> |
|
153 | 153 | <Compile Include="Components\IFactory.cs" /> |
|
154 | 154 | <Compile Include="Automaton\IAlphabet.cs" /> |
|
155 | 155 | <Compile Include="Automaton\ParserException.cs" /> |
|
156 | 156 | <Compile Include="Automaton\IndexedAlphabetBase.cs" /> |
|
157 | 157 | <Compile Include="Automaton\IAlphabetBuilder.cs" /> |
|
158 | 158 | <Compile Include="Automaton\RegularExpressions\AltToken.cs" /> |
|
159 | 159 | <Compile Include="Automaton\RegularExpressions\BinaryToken.cs" /> |
|
160 | 160 | <Compile Include="Automaton\RegularExpressions\CatToken.cs" /> |
|
161 | 161 | <Compile Include="Automaton\RegularExpressions\StarToken.cs" /> |
|
162 | 162 | <Compile Include="Automaton\RegularExpressions\SymbolToken.cs" /> |
|
163 | 163 | <Compile Include="Automaton\RegularExpressions\EmptyToken.cs" /> |
|
164 | 164 | <Compile Include="Automaton\RegularExpressions\Token.cs" /> |
|
165 | 165 | <Compile Include="Automaton\RegularExpressions\IVisitor.cs" /> |
|
166 | 166 | <Compile Include="Automaton\AutomatonTransition.cs" /> |
|
167 | 167 | <Compile Include="Formats\JSON\JSONElementContext.cs" /> |
|
168 | 168 | <Compile Include="Formats\JSON\JSONElementType.cs" /> |
|
169 | 169 | <Compile Include="Formats\JSON\JSONGrammar.cs" /> |
|
170 | 170 | <Compile Include="Formats\JSON\JSONParser.cs" /> |
|
171 | 171 | <Compile Include="Formats\JSON\JSONScanner.cs" /> |
|
172 | 172 | <Compile Include="Formats\JSON\JsonTokenType.cs" /> |
|
173 | 173 | <Compile Include="Formats\JSON\JSONWriter.cs" /> |
|
174 | 174 | <Compile Include="Formats\JSON\JSONXmlReader.cs" /> |
|
175 | 175 | <Compile Include="Formats\JSON\JSONXmlReaderOptions.cs" /> |
|
176 | 176 | <Compile Include="Formats\JSON\StringTranslator.cs" /> |
|
177 | 177 | <Compile Include="Automaton\MapAlphabet.cs" /> |
|
178 | 178 | <Compile Include="Formats\CharAlphabet.cs" /> |
|
179 | 179 | <Compile Include="Formats\ByteAlphabet.cs" /> |
|
180 | 180 | <Compile Include="Automaton\IDFATable.cs" /> |
|
181 | 181 | <Compile Include="Automaton\IDFATableBuilder.cs" /> |
|
182 | 182 | <Compile Include="Automaton\DFATable.cs" /> |
|
183 | 183 | <Compile Include="Automaton\RegularExpressions\RegularExpressionVisitor.cs" /> |
|
184 | 184 | <Compile Include="Automaton\RegularExpressions\ITaggedDFABuilder.cs" /> |
|
185 | 185 | <Compile Include="Formats\TextScanner.cs" /> |
|
186 | 186 | <Compile Include="Formats\StringScanner.cs" /> |
|
187 | 187 | <Compile Include="Formats\ReaderScanner.cs" /> |
|
188 | 188 | <Compile Include="Formats\ScannerContext.cs" /> |
|
189 | 189 | <Compile Include="Formats\Grammar.cs" /> |
|
190 | 190 | <Compile Include="Automaton\RegularExpressions\EndTokenT.cs" /> |
|
191 | 191 | <Compile Include="Automaton\RegularExpressions\EndToken.cs" /> |
|
192 | 192 | <Compile Include="Automaton\RegularExpressions\RegularExpressionVisitorT.cs" /> |
|
193 | 193 | <Compile Include="Automaton\AutomatonConst.cs" /> |
|
194 | 194 | <Compile Include="Automaton\RegularExpressions\RegularDFA.cs" /> |
|
195 | 195 | <Compile Include="Components\LazyAndWeak.cs" /> |
|
196 | 196 | <Compile Include="AbstractTask.cs" /> |
|
197 | 197 | <Compile Include="AbstractTaskT.cs" /> |
|
198 | 198 | <Compile Include="FailedPromise.cs" /> |
|
199 | 199 | <Compile Include="FailedPromiseT.cs" /> |
|
200 | 200 | <Compile Include="Components\PollingComponent.cs" /> |
|
201 | 201 | </ItemGroup> |
|
202 | 202 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
|
203 | 203 | <ItemGroup /> |
|
204 | 204 | <ProjectExtensions> |
|
205 | 205 | <MonoDevelop> |
|
206 | 206 | <Properties> |
|
207 | 207 | <Policies> |
|
208 | <CSharpFormattingPolicy IndentSwitchBody="True" NamespaceBraceStyle="EndOfLine" ClassBraceStyle="EndOfLine" InterfaceBraceStyle="EndOfLine" StructBraceStyle="EndOfLine" EnumBraceStyle="EndOfLine" MethodBraceStyle="EndOfLine" ConstructorBraceStyle="EndOfLine" DestructorBraceStyle="EndOfLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" NewLineBeforeConstructorInitializerColon="NewLine" NewLineAfterConstructorInitializerColon="SameLine" BeforeIndexerDeclarationBracket="False" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" SpacesBeforeBrackets="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" /> | |
|
209 | <TextStylePolicy FileWidth="120" EolMarker="Unix" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" /> | |
|
208 | <CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="False" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInProperties="False" NewLinesForBracesInAccessors="False" NewLinesForBracesInAnonymousMethods="False" NewLinesForBracesInControlBlocks="False" NewLinesForBracesInAnonymousTypes="False" NewLinesForBracesInObjectCollectionArrayInitializers="False" NewLinesForBracesInLambdaExpressionBody="False" NewLineForElse="False" NewLineForCatch="False" NewLineForFinally="False" NewLineForMembersInObjectInit="False" NewLineForMembersInAnonymousTypes="False" NewLineForClausesInQuery="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceAfterControlFlowStatementKeyword="True" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" SpacingAfterMethodDeclarationName="True" SpaceAfterMethodCallName="True" SpaceBeforeOpenSquareBracket="True" SpaceBeforeColonInBaseTypeDeclaration="True" scope="text/x-csharp" /> | |
|
209 | <TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" TabsToSpaces="True" EolMarker="Unix" scope="text/x-csharp" /> | |
|
210 | 210 | <DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedHierarchical" ResourceNamePolicy="MSBuild" /> |
|
211 |
<TextStylePolicy FileWidth="120" TabsToSpaces="False" |
|
|
212 |
<XmlFormattingPolicy |
|
|
213 | <TextStylePolicy FileWidth="120" TabsToSpaces="False" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/plain" /> | |
|
211 | <TextStylePolicy FileWidth="120" TabWidth="4" TabsToSpaces="False" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" scope="application/xml" /> | |
|
212 | <XmlFormattingPolicy scope="application/xml"> | |
|
213 | <DefaultFormat OmitXmlDeclaration="False" NewLineChars="
" IndentContent="True" ContentIndentString="	" AttributesInNewLine="False" MaxAttributesPerLine="10" AttributesIndentString="	" WrapAttributes="False" AlignAttributes="False" AlignAttributeValues="False" QuoteChar=""" SpacesBeforeAssignment="0" SpacesAfterAssignment="0" EmptyLinesBeforeStart="0" EmptyLinesAfterStart="0" EmptyLinesBeforeEnd="0" EmptyLinesAfterEnd="0" /> | |
|
214 | </XmlFormattingPolicy> | |
|
215 | <TextStylePolicy FileWidth="120" TabWidth="4" TabsToSpaces="False" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" scope="text/plain" /> | |
|
214 | 216 | <NameConventionPolicy> |
|
215 | 217 | <Rules> |
|
216 | 218 | <NamingRule Name="Namespaces" AffectedEntity="Namespace" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
217 | 219 | <NamingRule Name="Types" AffectedEntity="Class, Struct, Enum, Delegate" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
218 | 220 | <NamingRule Name="Interfaces" AffectedEntity="Interface" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"> |
|
219 | 221 | <RequiredPrefixes> |
|
220 | 222 | <String>I</String> |
|
221 | 223 | </RequiredPrefixes> |
|
222 | 224 | </NamingRule> |
|
223 | 225 | <NamingRule Name="Attributes" AffectedEntity="CustomAttributes" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"> |
|
224 | 226 | <RequiredSuffixes> |
|
225 | 227 | <String>Attribute</String> |
|
226 | 228 | </RequiredSuffixes> |
|
227 | 229 | </NamingRule> |
|
228 | 230 | <NamingRule Name="Event Arguments" AffectedEntity="CustomEventArgs" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"> |
|
229 | 231 | <RequiredSuffixes> |
|
230 | 232 | <String>EventArgs</String> |
|
231 | 233 | </RequiredSuffixes> |
|
232 | 234 | </NamingRule> |
|
233 | 235 | <NamingRule Name="Exceptions" AffectedEntity="CustomExceptions" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"> |
|
234 | 236 | <RequiredSuffixes> |
|
235 | 237 | <String>Exception</String> |
|
236 | 238 | </RequiredSuffixes> |
|
237 | 239 | </NamingRule> |
|
238 | 240 | <NamingRule Name="Methods" AffectedEntity="Methods" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
239 | 241 | <NamingRule Name="Static Readonly Fields" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Protected, Public" NamingStyle="CamelCase" IncludeInstanceMembers="False" IncludeStaticEntities="True" /> |
|
240 | 242 | <NamingRule Name="Fields (Non Private)" AffectedEntity="Field" VisibilityMask="Internal, Public" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
241 | 243 | <NamingRule Name="ReadOnly Fields (Non Private)" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Public" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False" /> |
|
242 | 244 | <NamingRule Name="Fields (Private)" AffectedEntity="Field, ReadonlyField" VisibilityMask="Private, Protected" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False"> |
|
243 | 245 | <RequiredPrefixes> |
|
244 | 246 | <String>m_</String> |
|
245 | 247 | </RequiredPrefixes> |
|
246 | 248 | </NamingRule> |
|
247 | 249 | <NamingRule Name="Static Fields (Private)" AffectedEntity="Field" VisibilityMask="Private" NamingStyle="CamelCase" IncludeInstanceMembers="False" IncludeStaticEntities="True"> |
|
248 | 250 | <RequiredPrefixes> |
|
249 | 251 | <String>_</String> |
|
250 | 252 | </RequiredPrefixes> |
|
251 | 253 | </NamingRule> |
|
252 | 254 | <NamingRule Name="ReadOnly Fields (Private)" AffectedEntity="ReadonlyField" VisibilityMask="Private, Protected" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False"> |
|
253 | 255 | <RequiredPrefixes> |
|
254 | 256 | <String>m_</String> |
|
255 | 257 | </RequiredPrefixes> |
|
256 | 258 | </NamingRule> |
|
257 | 259 | <NamingRule Name="Constant Fields" AffectedEntity="ConstantField" VisibilityMask="VisibilityMask" NamingStyle="AllUpper" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
258 | 260 | <NamingRule Name="Properties" AffectedEntity="Property" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
259 | 261 | <NamingRule Name="Events" AffectedEntity="Event" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
260 | 262 | <NamingRule Name="Enum Members" AffectedEntity="EnumMember" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
261 | 263 | <NamingRule Name="Parameters" AffectedEntity="Parameter, LocalVariable" VisibilityMask="VisibilityMask" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" /> |
|
262 | 264 | <NamingRule Name="Type Parameters" AffectedEntity="TypeParameter" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"> |
|
263 | 265 | <RequiredPrefixes> |
|
264 | 266 | <String>T</String> |
|
265 | 267 | </RequiredPrefixes> |
|
266 | 268 | </NamingRule> |
|
267 | 269 | </Rules> |
|
268 | 270 | </NameConventionPolicy> |
|
269 | 271 | </Policies> |
|
270 | 272 | </Properties> |
|
271 | 273 | </MonoDevelop> |
|
272 | 274 | </ProjectExtensions> |
|
273 | 275 | <ItemGroup /> |
|
274 | 276 | </Project> No newline at end of file |
General Comments 3
ok, latest stable version should be in default
You need to be logged in to leave comments.
Login now