├── .gitignore
├── JsonFx
├── History.txt
├── JsonFx.Json.UnitTests
│ ├── JsonFx.Json.UnitTests.csproj
│ ├── JsonFx.Json.UnitTests.pidb
│ ├── License.txt
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── AssemblyVersion.cs
│ ├── UnitTests
│ │ ├── JsonText.cs
│ │ ├── ReadMe.txt
│ │ └── StronglyTyped.cs
│ └── bin
│ │ ├── Debug
│ │ ├── JsonFx.Json.UnitTests.exe
│ │ ├── JsonFx.Json.UnitTests.exe.mdb
│ │ ├── JsonFx.Json.dll
│ │ ├── JsonFx.Json.dll.mdb
│ │ ├── License.txt
│ │ ├── Readme.txt
│ │ └── UnitTests
│ │ │ └── ReadMe.txt
│ │ └── Release
│ │ ├── JsonFx.Json.UnitTests.exe
│ │ ├── JsonFx.Json.dll
│ │ ├── License.txt
│ │ ├── Readme.txt
│ │ └── UnitTests
│ │ └── ReadMe.txt
├── JsonFx.Json.sln
├── JsonFx.Json.userprefs
├── JsonFx.Json
│ ├── About.cs
│ ├── DataReaderProvider.cs
│ ├── DataWriterProvider.cs
│ ├── EcmaScriptIdentifier.cs
│ ├── EcmaScriptWriter.cs
│ ├── IDataReader.cs
│ ├── IDataWriter.cs
│ ├── IJsonSerializable.cs
│ ├── JsonDataReader.cs
│ ├── JsonDataWriter.cs
│ ├── JsonFx.Json.csproj
│ ├── JsonFx.Json.pidb
│ ├── JsonIgnoreAttribute.cs
│ ├── JsonMemberAttribute.cs
│ ├── JsonNameAttribute.cs
│ ├── JsonOptInAttribute.cs
│ ├── JsonReader.cs
│ ├── JsonReaderSettings.cs
│ ├── JsonSerializationException.cs
│ ├── JsonSpecifiedPropertyAttribute.cs
│ ├── JsonToken.cs
│ ├── JsonWriter.cs
│ ├── JsonWriterSettings.cs
│ ├── License.txt
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── AssemblyVersion.cs
│ ├── Readme.txt
│ ├── Scripts
│ │ └── json2.js
│ ├── TypeCoercionUtility.cs
│ ├── XmlDataReader.cs
│ └── XmlDataWriter.cs
└── TODO.txt
└── Unity Examples
├── JsonConverters.cs
└── JsonFxDemo.cs
/.gitignore:
--------------------------------------------------------------------------------
1 | *.user
2 | *.suo
3 | JsonFx/JsonFx.Json/bin
4 | JsonFx/JsonFx.Json/obj
5 | JsonFx/JsonFx.Json.UnitTests/bin
6 | JsonFx/JsonFx.Json.UnitTests/obj
7 |
--------------------------------------------------------------------------------
/JsonFx/JsonFx.Json.UnitTests/JsonFx.Json.UnitTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.50727
7 | 2.0
8 | {9F616133-A5C3-48C7-95F3-2DCC01F8B03F}
9 | Exe
10 | Properties
11 | JsonFx.Json
12 | JsonFx.Json.UnitTests
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | v2.0
22 |
23 |
24 |
25 |
26 | 2.0
27 | publish\
28 | true
29 | Disk
30 | false
31 | Foreground
32 | 7
33 | Days
34 | false
35 | false
36 | true
37 | 0
38 | 1.0.0.%2a
39 | false
40 | false
41 | true
42 |
43 |
44 | true
45 | full
46 | false
47 | bin\Debug\
48 | DEBUG;TRACE
49 | prompt
50 | 4
51 |
52 |
53 | pdbonly
54 | true
55 | bin\Release\
56 | TRACE
57 | prompt
58 | 4
59 | false
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | Code
72 |
73 |
74 |
75 |
76 | Always
77 |
78 |
79 | Always
80 |
81 |
82 |
83 |
84 | False
85 | .NET Framework 3.5 SP1 Client Profile
86 | false
87 |
88 |
89 | False
90 | .NET Framework 3.5 SP1
91 | true
92 |
93 |
94 | False
95 | Windows Installer 3.1
96 | true
97 |
98 |
99 |
100 |
101 | {ABA23F14-7E47-43FE-A3E7-1FF97840C3FB}
102 | JsonFx.Json
103 |
104 |
105 |
106 |
113 |
--------------------------------------------------------------------------------
/JsonFx/JsonFx.Json.UnitTests/JsonFx.Json.UnitTests.pidb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piplay-fork/jsonfx-for-unity3d/b4bf550cf81fab69448d97c12efed78a50d3c538/JsonFx/JsonFx.Json.UnitTests/JsonFx.Json.UnitTests.pidb
--------------------------------------------------------------------------------
/JsonFx/JsonFx.Json.UnitTests/License.txt:
--------------------------------------------------------------------------------
1 | Distributed under the terms of an MIT-style license:
2 |
3 | The MIT License
4 |
5 | Copyright (c) 2006-2009 Stephen M. McKamey
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/JsonFx/JsonFx.Json.UnitTests/Program.cs:
--------------------------------------------------------------------------------
1 | #region License
2 | /*---------------------------------------------------------------------------------*\
3 |
4 | Distributed under the terms of an MIT-style license:
5 |
6 | The MIT License
7 |
8 | Copyright (c) 2006-2008 Stephen M. McKamey
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in
18 | all copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 | THE SOFTWARE.
27 |
28 | \*---------------------------------------------------------------------------------*/
29 | #endregion License
30 |
31 | using System;
32 | using System.IO;
33 | using System.Text;
34 | using System.Diagnostics;
35 |
36 | using JsonFx.Json;
37 |
38 | namespace JsonFx.Json.Test
39 | {
40 | class Program
41 | {
42 | #region Constants
43 |
44 | private const string ReportPath = "{0:yyyy-MM-dd-HHmmss}_Report.txt";
45 | private const string UnitTestsFolder = @".\UnitTests\";
46 | private const string OutputFolder = @".\Output\";
47 | private const string HeaderMessage =
48 | "NOTE: JsonFx.Json accepts all valid JSON and can recover from many minor errors.\r\n\r\n"+
49 | "Unit Test Report ({0:yyyy-MM-dd @ HH:mm:ss})";
50 |
51 | #endregion Constants
52 |
53 | #region Program Entry
54 |
55 | static void Main(string[] args)
56 | {
57 | DateTime now = DateTime.Now;
58 | string reportPath = String.Format(ReportPath, now);
59 | const int Count = 100;
60 | double total = 0;
61 |
62 | for (int i=0; i 0)
59 | {
60 | JsonReaderSettings readerSettings = new JsonReaderSettings();
61 | readerSettings.TypeHintName = StronglyTyped.MyTypeHintName;
62 | readerSettings.AllowNullValueTypes = true;
63 | readerSettings.AllowUnquotedObjectKeys = true;
64 |
65 | JsonWriterSettings writerSettings = new JsonWriterSettings();
66 | writerSettings.TypeHintName = StronglyTyped.MyTypeHintName;
67 | writerSettings.PrettyPrint = false;
68 | writerSettings.MaxDepth = 100;
69 |
70 | writer.WriteLine(JsonText.Seperator);
71 | writer.WriteLine("JsonReaderSettings:");
72 | new JsonWriter(writer).Write(readerSettings);
73 |
74 | writer.WriteLine(JsonText.Seperator);
75 | writer.WriteLine("JsonWriterSettings:");
76 | new JsonWriter(writer).Write(writerSettings);
77 |
78 | foreach (string unitTest in unitTests)
79 | {
80 | string source = String.Empty;
81 |
82 | try
83 | {
84 | writer.WriteLine(JsonText.Seperator);
85 |
86 | source = File.ReadAllText(unitTest);
87 | JsonReader jsonReader = new JsonReader(source, readerSettings);
88 |
89 | object obj, obj2;
90 | obj2 = obj = jsonReader.Deserialize();
91 |
92 | do
93 | {
94 | writer.WriteLine("READ: {0}", unitTest.Replace(unitTestsFolder, ""));
95 | writer.WriteLine("Result: {0}", (obj == null) ? "null" : obj.GetType().FullName);
96 |
97 | obj = jsonReader.Deserialize();
98 | } while (obj != null);
99 |
100 | string outputFile = unitTest.Replace(unitTestsFolder, outputFolder);
101 | string outputDir = Path.GetDirectoryName(outputFile);
102 | if (!Directory.Exists(outputDir))
103 | {
104 | Directory.CreateDirectory(outputDir);
105 | }
106 | using (JsonWriter jsonWriter = new JsonWriter(outputFile, writerSettings))
107 | {
108 | jsonWriter.Write(obj2);
109 | }
110 | }
111 | catch (JsonDeserializationException ex)
112 | {
113 | int col, line;
114 | ex.GetLineAndColumn(source, out line, out col);
115 |
116 | writer.WriteLine("ERROR: {0}", unitTest.Replace(unitTestsFolder, ""));
117 | writer.WriteLine("-- \"{0}\" ({1}, {2})", ex.Message, line, col);
118 | continue;
119 | }
120 | catch (Exception ex)
121 | {
122 | writer.WriteLine("ERROR: {0}", unitTest.Replace(unitTestsFolder, ""));
123 | writer.WriteLine("-- \"{0}\"", ex.Message);
124 | continue;
125 | }
126 | }
127 | }
128 | else
129 | {
130 | writer.WriteLine(ErrorMessage);
131 | }
132 | }
133 |
134 | #endregion Methods
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/JsonFx/JsonFx.Json.UnitTests/UnitTests/ReadMe.txt:
--------------------------------------------------------------------------------
1 | Any *.json file in this folder will be processed.
2 |
3 | Download http://www.json.org/JSON_checker/test.zip and place contents into this folder.
4 |
--------------------------------------------------------------------------------
/JsonFx/JsonFx.Json.UnitTests/UnitTests/StronglyTyped.cs:
--------------------------------------------------------------------------------
1 | #region License
2 | /*---------------------------------------------------------------------------------*\
3 |
4 | Distributed under the terms of an MIT-style license:
5 |
6 | The MIT License
7 |
8 | Copyright (c) 2006-2008 Stephen M. McKamey
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in
18 | all copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 | THE SOFTWARE.
27 |
28 | \*---------------------------------------------------------------------------------*/
29 | #endregion License
30 |
31 | using System;
32 | using System.IO;
33 | using System.ComponentModel;
34 | using System.Collections;
35 | using System.Collections.Generic;
36 | using System.Collections.Specialized;
37 | using System.Text;
38 |
39 | using JsonFx.Json;
40 |
41 | namespace JsonFx.Json.Test.UnitTests
42 | {
43 | /* A set of objects used to test strongly-typed serialization */
44 |
45 | public class StronglyTyped
46 | {
47 | #region Constants
48 |
49 | public const string MyTypeHintName = "__type";
50 |
51 | #endregion Constants
52 |
53 | #region Methods
54 |
55 | public static void RunTest(TextWriter writer, string unitTestsFolder, string outputFolder)
56 | {
57 | JsonReaderSettings readerSettings = new JsonReaderSettings();
58 | readerSettings.TypeHintName = StronglyTyped.MyTypeHintName;
59 | readerSettings.AllowNullValueTypes = true;
60 | readerSettings.AllowUnquotedObjectKeys = false;
61 |
62 | JsonWriterSettings writerSettings = new JsonWriterSettings();
63 | writerSettings.TypeHintName = StronglyTyped.MyTypeHintName;
64 | writerSettings.PrettyPrint = true;
65 | writerSettings.MaxDepth = 100;
66 |
67 | writer.WriteLine(JsonText.Seperator);
68 | writer.WriteLine("JsonReaderSettings:");
69 | new JsonWriter(writer).Write(readerSettings);
70 |
71 | writer.WriteLine(JsonText.Seperator);
72 | writer.WriteLine("JsonWriterSettings:");
73 | new JsonWriter(writer).Write(writerSettings);
74 |
75 | #region Simple Root Types
76 |
77 | SerializeDeserialize(writer, unitTestsFolder, "RootEnum.json", BlahBlah.Three, readerSettings, writerSettings);
78 |
79 | SerializeDeserialize(writer, unitTestsFolder, "RootInt64.json", 42678L, readerSettings, writerSettings);
80 |
81 | SerializeDeserialize(writer, unitTestsFolder, "RootDateTime.json", DateTime.Now, readerSettings, writerSettings);
82 |
83 | #endregion Simple Root Types
84 |
85 | #region Strongly Typed Object Graph Test
86 |
87 | ComplexObject collectionTest = new ComplexObject();
88 |
89 | collectionTest.MyNested = new NestedObject();
90 | collectionTest.MyNested.Items = new Dictionary();
91 | collectionTest.MyNested.Items["First"] = 3.14159;
92 | collectionTest.MyNested.Items["Second"] = "Hello World";
93 | collectionTest.MyNested.Items["Third"] = 42;
94 | collectionTest.MyNested.Items["Fourth"] = true;
95 |
96 | collectionTest.MyNested.Hash = new Hashtable(collectionTest.MyNested.Items);
97 |
98 | collectionTest.MyNested.Hybrid = new HybridDictionary();
99 | foreach (string key in collectionTest.MyNested.Items.Keys)
100 | {
101 | collectionTest.MyNested.Hybrid[key] = collectionTest.MyNested.Items[key];
102 | }
103 |
104 | // populate with an Array
105 | collectionTest.MyArray = new SimpleObject[]{
106 | new SimpleObject(BlahBlah.Four),
107 | new SimpleObject(BlahBlah.Three),
108 | new SimpleObject(BlahBlah.Two),
109 | new SimpleObject(BlahBlah.One),
110 | new SimpleObject()
111 | };
112 |
113 | // duplicate for ArrayList
114 | collectionTest.MyArrayList = new ArrayList(collectionTest.MyArray);
115 |
116 | // duplicate for List
117 | collectionTest.MyList = new List(collectionTest.MyArray);
118 |
119 | // duplicate for LinkedList
120 | collectionTest.MyLinkedList = new LinkedList(collectionTest.MyArray);
121 |
122 | // duplicate for Stack
123 | collectionTest.MyStack = new Stack(collectionTest.MyArray);
124 |
125 | // duplicate for Queue
126 | collectionTest.MyQueue = new Queue(collectionTest.MyArray);
127 |
128 | SerializeDeserialize(writer, unitTestsFolder, "StronglyTyped.json", collectionTest, readerSettings, writerSettings);
129 |
130 | #endregion Strongly Typed Object Graph Test
131 |
132 | #region Non-IDictionary, IDictionary Test
133 |
134 | NotIDictionary notIDictionary = new NotIDictionary();
135 | notIDictionary["This Collection"] = "is not an IDictionary";
136 | notIDictionary["But It is"] = "an IDictionary";
137 |
138 | SerializeDeserialize(writer, unitTestsFolder, "NotIDictionary.json", notIDictionary, readerSettings, writerSettings);
139 |
140 | #endregion Non-IDictionary ,IDictionary Test
141 | }
142 |
143 | private static void SerializeDeserialize(TextWriter writer, string unitTestsFolder, string unitTestFile, object obj, JsonReaderSettings readerSettings, JsonWriterSettings writerSettings)
144 | {
145 | writer.WriteLine(JsonText.Seperator);
146 |
147 | string source = String.Empty;
148 | try
149 | {
150 | using (JsonWriter jsonWriter = new JsonWriter(unitTestsFolder+unitTestFile, writerSettings))
151 | {
152 | jsonWriter.Write(obj);
153 | }
154 |
155 | source = File.ReadAllText(unitTestsFolder+unitTestFile);
156 |
157 | obj = new JsonReader(source, readerSettings).Deserialize((obj == null) ? null : obj.GetType());
158 | writer.WriteLine("READ: "+unitTestFile);
159 | writer.WriteLine("Result: {0}", (obj == null) ? "null" : obj.GetType().FullName);
160 | }
161 | catch (JsonDeserializationException ex)
162 | {
163 | int col, line;
164 | writer.WriteLine("ERROR: "+unitTestFile);
165 | ex.GetLineAndColumn(source, out line, out col);
166 | writer.WriteLine("-- \"{0}\" ({1}, {2})", ex.Message, line, col);
167 | }
168 | catch (Exception ex)
169 | {
170 | writer.WriteLine("ERROR: "+unitTestFile);
171 | writer.WriteLine("-- \"{0}\"", ex.Message);
172 | }
173 | }
174 |
175 | #endregion Methods
176 | }
177 |
178 | public class ComplexObject
179 | {
180 | #region Fields
181 |
182 | private Decimal myDecimal = 0.12345678901234567890123456789m;
183 | private Guid myGuid = Guid.NewGuid();
184 | private TimeSpan myTimeSpan = new TimeSpan(5, 4, 3, 2, 1);
185 | private Version myVersion = new Version(1, 2, 3, 4);
186 | private Uri myUri = new Uri("http://jsonfx.net/BuildTools");
187 | private DateTime myDateTime = DateTime.UtcNow;
188 | private Nullable myNullableInt32 = null;
189 | private Nullable myNullableInt64a = null;
190 | private Nullable myNullableInt64b = 42;
191 | private Nullable myNullableDateTime = DateTime.Now;
192 | private SimpleObject[] myArray = null;
193 | private ArrayList myArrayList = null;
194 | private List myList = null;
195 | private LinkedList myLinkedList = null;
196 | private Stack myStack = null;
197 | private Queue myQueue = null;
198 | private NestedObject myNested = null;
199 |
200 | #endregion Fields
201 |
202 | #region Properties
203 |
204 | [JsonName("AnArbitraryRenameForMyNestedProperty")]
205 | public NestedObject MyNested
206 | {
207 | get { return this.myNested; }
208 | set { this.myNested = value; }
209 | }
210 |
211 | public Decimal MyDecimal
212 | {
213 | get { return this.myDecimal; }
214 | set { this.myDecimal = value; }
215 | }
216 |
217 | public Guid MyGuid
218 | {
219 | get { return this.myGuid; }
220 | set { this.myGuid = value; }
221 | }
222 |
223 | public TimeSpan MyTimeSpan
224 | {
225 | get { return this.myTimeSpan; }
226 | set { this.myTimeSpan = value; }
227 | }
228 |
229 | public Version MyVersion
230 | {
231 | get { return this.myVersion; }
232 | set { this.myVersion = value; }
233 | }
234 |
235 | public Uri MyUri
236 | {
237 | get { return this.myUri; }
238 | set { this.myUri = value; }
239 | }
240 |
241 | public DateTime MyDateTime
242 | {
243 | get { return this.myDateTime; }
244 | set { this.myDateTime = value; }
245 | }
246 |
247 | public Nullable MyNullableInt32
248 | {
249 | get { return this.myNullableInt32; }
250 | set { this.myNullableInt32 = value; }
251 | }
252 |
253 | public Nullable MyNullableDateTime
254 | {
255 | get { return this.myNullableDateTime; }
256 | set { this.myNullableDateTime = value; }
257 | }
258 |
259 | [DefaultValue(null)]
260 | public Nullable MyNullableInt64a
261 | {
262 | get { return this.myNullableInt64a; }
263 | set { this.myNullableInt64a = value; }
264 | }
265 |
266 | [DefaultValue(null)]
267 | public Nullable MyNullableInt64b
268 | {
269 | get { return this.myNullableInt64b; }
270 | set { this.myNullableInt64b = value; }
271 | }
272 |
273 | public SimpleObject[] MyArray
274 | {
275 | get { return this.myArray; }
276 | set { this.myArray = value; }
277 | }
278 |
279 | public ArrayList MyArrayList
280 | {
281 | get { return this.myArrayList; }
282 | set { this.myArrayList = value; }
283 | }
284 |
285 | public List MyList
286 | {
287 | get { return this.myList; }
288 | set { this.myList = value; }
289 | }
290 |
291 | [JsonSpecifiedProperty("SerializeMyStack")]
292 | public Stack MyStack
293 | {
294 | get { return this.myStack; }
295 | set { this.myStack = value; }
296 | }
297 |
298 | [JsonIgnore]
299 | public bool SerializeMyStack
300 | {
301 | get { return false; }
302 | set { /* do nothing */ }
303 | }
304 |
305 | public LinkedList MyLinkedList
306 | {
307 | get { return this.myLinkedList; }
308 | set { this.myLinkedList = value; }
309 | }
310 |
311 | public Queue MyQueue
312 | {
313 | get { return this.myQueue; }
314 | set { this.myQueue = value; }
315 | }
316 |
317 | #endregion Properties
318 | }
319 |
320 | public class NotIDictionary : IDictionary
321 | {
322 | #region Fields
323 |
324 | private IDictionary dictionary = new Dictionary();
325 |
326 | #endregion Fields
327 |
328 | #region IDictionary Members
329 |
330 | public object this[string key]
331 | {
332 | get { return this.dictionary[key]; }
333 | set { this.dictionary[key] = value; }
334 | }
335 |
336 | void IDictionary.Add(string key, object value)
337 | {
338 | this.dictionary.Add(key, value);
339 | }
340 |
341 | bool IDictionary.ContainsKey(string key)
342 | {
343 | return this.dictionary.ContainsKey(key);
344 | }
345 |
346 | ICollection IDictionary.Keys
347 | {
348 | get { return this.dictionary.Keys; }
349 | }
350 |
351 | bool IDictionary.Remove(string key)
352 | {
353 | return this.dictionary.Remove(key);
354 | }
355 |
356 | bool IDictionary.TryGetValue(string key, out object value)
357 | {
358 | return this.dictionary.TryGetValue(key, out value);
359 | }
360 |
361 | ICollection