├── .editorconfig ├── .gitattributes ├── .gitignore ├── Json.Net.Unity3D.sln ├── LICENSE ├── NOTE.md ├── README.md ├── appveyor.yml ├── build.cmd ├── build.fsx ├── docs ├── UnitTest.md ├── UnitTestResult.png ├── UnitTestSummary.png └── UwpWorkaround.md ├── src ├── Newtonsoft.Json.Tests │ ├── Bson │ │ ├── BsonReaderTests.cs │ │ └── BsonWriterTests.cs │ ├── Converters │ │ ├── BinaryConverterTests.cs │ │ ├── CustomCreationConverterTests.cs │ │ ├── DataSetConverterTests.cs │ │ ├── DataTableConverterTests.cs │ │ ├── DiscriminatedUnionConverterTests.cs │ │ ├── ExpandoObjectConverterTests.cs │ │ ├── IsoDateTimeConverterTests.cs │ │ ├── JavaScriptDateTimeConverterTests.cs │ │ ├── JsonValueConverterTests.cs │ │ ├── KeyValuePairConverterTests.cs │ │ ├── ObjectIdConverterTests.cs │ │ ├── RegexConverterTests.cs │ │ ├── StringEnumConverterTests.cs │ │ ├── VersionConverterTests.cs │ │ └── XmlNodeConverterTest.cs │ ├── ExceptionTests.cs │ ├── JsonArrayAttributeTests.cs │ ├── JsonConvertTest.cs │ ├── JsonTextReaderTest.cs │ ├── JsonTextWriterTest.cs │ ├── Linq │ │ ├── AnnotationsTests.cs │ │ ├── ComponentModel │ │ │ ├── BindingTests.cs │ │ │ └── JPropertyDescriptorTests.cs │ │ ├── DynamicTests.cs │ │ ├── JArrayTests.cs │ │ ├── JConstructorTests.cs │ │ ├── JObjectTests.cs │ │ ├── JPropertyTests.cs │ │ ├── JRawTests.cs │ │ ├── JTokenEqualityComparerTests.cs │ │ ├── JTokenReaderTest.cs │ │ ├── JTokenTests.cs │ │ ├── JTokenWriterTest.cs │ │ ├── JValueTests.cs │ │ ├── JsonPath │ │ │ ├── JPathExecuteTests.cs │ │ │ ├── JPathParseTests.cs │ │ │ └── QueryExpressionTests.cs │ │ ├── LinqToJsonTest.cs │ │ └── MergeTests.cs │ ├── LinqToSql │ │ ├── Department.cs │ │ ├── DepartmentConverter.cs │ │ ├── GuidByteArrayConverter.cs │ │ ├── LinqToSqlClasses.designer.cs │ │ ├── LinqToSqlClassesSerializationTests.cs │ │ ├── Person.cs │ │ └── Role.cs │ ├── Newtonsoft.Json.Tests.csproj │ ├── PerformanceTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Serialization │ │ ├── CamelCasePropertyNamesContractResolverTests.cs │ │ ├── ConstructorHandlingTests.cs │ │ ├── ContractResolverTests.cs │ │ ├── DefaultValueHandlingTests.cs │ │ ├── DependencyInjectionTests.cs │ │ ├── DynamicConcreteTests.cs │ │ ├── DynamicTests.cs │ │ ├── EntitiesSerializationTests.cs │ │ ├── ExtensionDataTests.cs │ │ ├── FSharpTests.cs │ │ ├── ImmutableCollectionsTests.cs │ │ ├── JsonPropertyCollectionTests.cs │ │ ├── JsonSerializerCollectionsTests.cs │ │ ├── JsonSerializerTest.cs │ │ ├── MetadataPropertyHandlingTests.cs │ │ ├── MissingMemberHandlingTests.cs │ │ ├── NullValueHandlingTests.cs │ │ ├── PopulateTests.cs │ │ ├── PreserveReferencesHandlingTests.cs │ │ ├── ReferenceLoopHandlingTests.cs │ │ ├── ReflectionAttributeProviderTests.cs │ │ ├── SerializationErrorHandlingTests.cs │ │ ├── SerializationEventAttributeTests.cs │ │ ├── ShouldSerializeTests.cs │ │ ├── TraceWriterTests.cs │ │ ├── TypeNameHandlingTests.cs │ │ └── WebApiIntegrationTests.cs │ ├── SpaceShipV2.bson │ ├── TestFixtureBase.cs │ ├── TestObjects │ │ ├── Aa.cs │ │ ├── AbstractGenericBase.cs │ │ ├── AnswerFilterModel.cs │ │ ├── Antworten.cs │ │ ├── ArgumentConverterPrecedenceClassConverter.cs │ │ ├── Article.cs │ │ ├── ArticleCollection.cs │ │ ├── BadJsonPropertyClass.cs │ │ ├── Bar.cs │ │ ├── Bb.cs │ │ ├── Car.cs │ │ ├── CircularReferenceClass.cs │ │ ├── CircularReferenceWithIdClass.cs │ │ ├── ClassAndMemberConverterClass.cs │ │ ├── ClassConverterPrecedenceClassConverter.cs │ │ ├── ClassWithArray.cs │ │ ├── ClassWithGuid.cs │ │ ├── Component.cs │ │ ├── Computer.cs │ │ ├── ConstructorCaseSensitivityClass.cs │ │ ├── ConstructorReadonlyFields.cs │ │ ├── Container.cs │ │ ├── Content.cs │ │ ├── ContentBaseClass.cs │ │ ├── ContentSubClass.cs │ │ ├── ConverableMembers.cs │ │ ├── ConverterPrecedenceClass.cs │ │ ├── ConverterPrecedenceClassConverter.cs │ │ ├── Currency.cs │ │ ├── CustomerDataSet.cs │ │ ├── DataContractSerializationAttributesClass.cs │ │ ├── DateTimeErrorObjectCollection.cs │ │ ├── DateTimeTestClass.cs │ │ ├── DateTimeWrapper.cs │ │ ├── DecimalTestClass.cs │ │ ├── DefaultValueAttributeTestClass.cs │ │ ├── DictionaryInterfaceClass.cs │ │ ├── DirectoryAccount.cs │ │ ├── DoubleClass.cs │ │ ├── EmployeeReference.cs │ │ ├── Event.cs │ │ ├── Event1.cs │ │ ├── Foo.cs │ │ ├── GameObject.cs │ │ ├── GenericImpl.cs │ │ ├── GenericListAndDictionaryInterfaceProperties.cs │ │ ├── GetOnlyPropertyClass.cs │ │ ├── GoogleMapGeocoderStructure.cs │ │ ├── HolderClass.cs │ │ ├── IMyInterface.cs │ │ ├── IPrivateImplementationA.cs │ │ ├── IPrivateImplementationB.cs │ │ ├── IPrivateOverriddenImplementation.cs │ │ ├── IdReferenceResolver.cs │ │ ├── IncompatibleJsonAttributeClass.cs │ │ ├── IntToFloatConverter.cs │ │ ├── InterfacePropertyTestClass.cs │ │ ├── Invoice.cs │ │ ├── Item.cs │ │ ├── JaggedArray.cs │ │ ├── JsonIgnoreAttributeOnClassTestClass.cs │ │ ├── JsonIgnoreAttributeTestClass.cs │ │ ├── JsonPropertyClass.cs │ │ ├── JsonPropertyWithHandlingValues.cs │ │ ├── ListErrorObject.cs │ │ ├── ListErrorObjectCollection.cs │ │ ├── ListOfIds.cs │ │ ├── ListTestClass.cs │ │ ├── LogEntry.cs │ │ ├── MemberConverterClass.cs │ │ ├── MemberConverterPrecedenceClassConverter.cs │ │ ├── MethodExecutorObject.cs │ │ ├── MetroPropertyNameResolver.cs │ │ ├── MetroStringConverter.cs │ │ ├── Movie.cs │ │ ├── MyClass.cs │ │ ├── Name.cs │ │ ├── NonRequest.cs │ │ ├── NullableDateTimeTestClass.cs │ │ ├── NullableGuid.cs │ │ ├── ObjectArrayPropertyTest.cs │ │ ├── ParticipantEntity.cs │ │ ├── Person.cs │ │ ├── PersonError.cs │ │ ├── PersonPropertyClass.cs │ │ ├── PersonRaw.cs │ │ ├── PersonReference.cs │ │ ├── PersonSerializable.cs │ │ ├── PersonWithPrivateConstructor.cs │ │ ├── PhoneNumber.cs │ │ ├── PocoDataContractSerializationAttributesClass.cs │ │ ├── PrivateConstructorTestClass.cs │ │ ├── PrivateConstructorWithPublicParameterizedConstructorTestClass.cs │ │ ├── PrivateImplementationAClass.cs │ │ ├── PrivateImplementationBClass.cs │ │ ├── PrivateMembersClass.cs │ │ ├── Product.cs │ │ ├── ProductCollection.cs │ │ ├── ProductShort.cs │ │ ├── PropertyCase.cs │ │ ├── PropertyItemConverter.cs │ │ ├── PublicParameterizedConstructorRequiringConverterTestClass.cs │ │ ├── PublicParameterizedConstructorTestClass.cs │ │ ├── PublicParameterizedConstructorWithNonPropertyParameterTestClass.cs │ │ ├── PublicParameterizedConstructorWithPropertyNameConflict.cs │ │ ├── Ratio.cs │ │ ├── RequestOnly.cs │ │ ├── RequiredMembersClass.cs │ │ ├── RequiredObject.cs │ │ ├── RoleTransfer.cs │ │ ├── SearchResult.cs │ │ ├── SelectListItem.cs │ │ ├── SerializationEventTestDictionary.cs │ │ ├── SerializationEventTestList.cs │ │ ├── SerializationEventTestObject.cs │ │ ├── SerializationEventTestObjectWithConstructor.cs │ │ ├── SetOnlyPropertyClass.cs │ │ ├── SetOnlyPropertyClass2.cs │ │ ├── Shape.cs │ │ ├── Shortie.cs │ │ ├── SqlTypesDataSet.Designer.cs │ │ ├── Store.cs │ │ ├── StoreColor.cs │ │ ├── StructTest.cs │ │ ├── SubKlass.cs │ │ ├── SuperKlass.cs │ │ ├── TestComponent.cs │ │ ├── TestComponentSimple.cs │ │ ├── TestObject.cs │ │ ├── TypeClass.cs │ │ ├── TypedSubHashtable.cs │ │ ├── UriGuidTimeSpanTestClass.cs │ │ ├── UserNullable.cs │ │ ├── VersionKeyedCollection.cs │ │ ├── WagePerson.cs │ │ ├── Widget.cs │ │ ├── Widget1.cs │ │ ├── WidgetId.cs │ │ ├── WidgetId1.cs │ │ ├── WidgetIdJsonConverter.cs │ │ └── WithEnums.cs │ ├── Utilities │ │ ├── ConvertUtilsTests.cs │ │ ├── DateTimeUtilsTests.cs │ │ ├── DynamicReflectionDelegateFactoryTests.cs │ │ ├── ExpressionReflectionDelegateFactoryTests.cs │ │ ├── LateboundReflectionDelegateFactoryTests.cs │ │ ├── ReflectionUtilsTests.cs │ │ └── StringUtilsTests.cs │ ├── copy_sources_from_origin.py │ ├── large.json │ └── packages.config ├── Newtonsoft.Json │ ├── Bson │ │ ├── BsonBinaryType.cs │ │ ├── BsonBinaryWriter.cs │ │ ├── BsonObjectId.cs │ │ ├── BsonReader.cs │ │ ├── BsonToken.cs │ │ ├── BsonType.cs │ │ └── BsonWriter.cs │ ├── ConstructorHandling.cs │ ├── Converters │ │ ├── BinaryConverter.cs │ │ ├── BsonObjectIdConverter.cs │ │ ├── CustomCreationConverter.cs │ │ ├── DataSetConverter.cs │ │ ├── DataTableConverter.cs │ │ ├── DateTimeConverterBase.cs │ │ ├── DiscriminatedUnionConverter.cs │ │ ├── EntityKeyMemberConverter.cs │ │ ├── ExpandoObjectConverter.cs │ │ ├── IsoDateTimeConverter.cs │ │ ├── JavaScriptDateTimeConverter.cs │ │ ├── JsonValueConverter.cs │ │ ├── KeyValuePairConverter.cs │ │ ├── RegexConverter.cs │ │ ├── StringEnumConverter.cs │ │ ├── VersionConverter.cs │ │ └── XmlNodeConverter.cs │ ├── DateFormatHandling.cs │ ├── DateParseHandling.cs │ ├── DateTimeZoneHandling.cs │ ├── DefaultValueHandling.cs │ ├── FloatFormatHandling.cs │ ├── FloatParseHandling.cs │ ├── FormatterAssemblyStyle.cs │ ├── Formatting.cs │ ├── IArrayPool.cs │ ├── IJsonLineInfo.cs │ ├── JsonArrayAttribute.cs │ ├── JsonConstructorAttribute.cs │ ├── JsonContainerAttribute.cs │ ├── JsonConvert.cs │ ├── JsonConverter.cs │ ├── JsonConverterAttribute.cs │ ├── JsonConverterCollection.cs │ ├── JsonDictionaryAttribute.cs │ ├── JsonException.cs │ ├── JsonExtensionDataAttribute.cs │ ├── JsonIgnoreAttribute.cs │ ├── JsonObjectAttribute.cs │ ├── JsonPosition.cs │ ├── JsonPropertyAttribute.cs │ ├── JsonReader.cs │ ├── JsonReaderException.cs │ ├── JsonRequiredAttribute.cs │ ├── JsonSerializationException.cs │ ├── JsonSerializer.cs │ ├── JsonSerializerSettings.cs │ ├── JsonTextReader.cs │ ├── JsonTextWriter.cs │ ├── JsonToken.cs │ ├── JsonValidatingReader.cs │ ├── JsonWriter.cs │ ├── JsonWriterException.cs │ ├── Linq │ │ ├── CommentHandling.cs │ │ ├── Extensions.cs │ │ ├── IJEnumerable.cs │ │ ├── JArray.cs │ │ ├── JConstructor.cs │ │ ├── JContainer.cs │ │ ├── JEnumerable.cs │ │ ├── JObject.cs │ │ ├── JProperty.cs │ │ ├── JPropertyDescriptor.cs │ │ ├── JPropertyKeyedCollection.cs │ │ ├── JRaw.cs │ │ ├── JToken.cs │ │ ├── JTokenEqualityComparer.cs │ │ ├── JTokenReader.cs │ │ ├── JTokenType.cs │ │ ├── JTokenWriter.cs │ │ ├── JValue.cs │ │ ├── JsonLoadSettings.cs │ │ ├── JsonMergeSettings.cs │ │ ├── JsonPath │ │ │ ├── ArrayIndexFilter.cs │ │ │ ├── ArrayMultipleIndexFilter.cs │ │ │ ├── ArraySliceFilter.cs │ │ │ ├── FieldFilter.cs │ │ │ ├── FieldMultipleFilter.cs │ │ │ ├── JPath.cs │ │ │ ├── PathFilter.cs │ │ │ ├── QueryExpression.cs │ │ │ ├── QueryFilter.cs │ │ │ └── ScanFilter.cs │ │ ├── MergeArrayHandling.cs │ │ └── MergeNullValueHandling.cs │ ├── MemberSerialization.cs │ ├── MetadataPropertyHandling.cs │ ├── MissingMemberHandling.cs │ ├── Newtonsoft.Json.csproj │ ├── NullValueHandling.cs │ ├── ObjectCreationHandling.cs │ ├── PreserveReferencesHandling.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ReferenceLoopHandling.cs │ ├── Required.cs │ ├── Schema │ │ ├── Extensions.cs │ │ ├── JsonSchema.cs │ │ ├── JsonSchemaBuilder.cs │ │ ├── JsonSchemaConstants.cs │ │ ├── JsonSchemaException.cs │ │ ├── JsonSchemaGenerator.cs │ │ ├── JsonSchemaModel.cs │ │ ├── JsonSchemaModelBuilder.cs │ │ ├── JsonSchemaNode.cs │ │ ├── JsonSchemaNodeCollection.cs │ │ ├── JsonSchemaResolver.cs │ │ ├── JsonSchemaType.cs │ │ ├── JsonSchemaWriter.cs │ │ ├── UndefinedSchemaIdHandling.cs │ │ ├── ValidationEventArgs.cs │ │ └── ValidationEventHandler.cs │ ├── Serialization │ │ ├── CachedAttributeGetter.cs │ │ ├── CamelCaseNamingStrategy.cs │ │ ├── CamelCasePropertyNamesContractResolver.cs │ │ ├── DefaultContractResolver.cs │ │ ├── DefaultReferenceResolver.cs │ │ ├── DefaultSerializationBinder.cs │ │ ├── DiagnosticsTraceWriter.cs │ │ ├── DynamicValueProvider.cs │ │ ├── ErrorContext.cs │ │ ├── ErrorEventArgs.cs │ │ ├── ExpressionValueProvider.cs │ │ ├── IAttributeProvider.cs │ │ ├── IContractResolver.cs │ │ ├── IReferenceResolver.cs │ │ ├── ITraceWriter.cs │ │ ├── IValueProvider.cs │ │ ├── JsonArrayContract.cs │ │ ├── JsonContainerContract.cs │ │ ├── JsonContract.cs │ │ ├── JsonDictionaryContract.cs │ │ ├── JsonDynamicContract.cs │ │ ├── JsonFormatterConverter.cs │ │ ├── JsonISerializableContract.cs │ │ ├── JsonLinqContract.cs │ │ ├── JsonObjectContract.cs │ │ ├── JsonPrimitiveContract.cs │ │ ├── JsonProperty.cs │ │ ├── JsonPropertyCollection.cs │ │ ├── JsonSerializerInternalBase.cs │ │ ├── JsonSerializerInternalReader.cs │ │ ├── JsonSerializerInternalWriter.cs │ │ ├── JsonSerializerProxy.cs │ │ ├── JsonStringContract.cs │ │ ├── JsonTypeReflector.cs │ │ ├── MemoryTraceWriter.cs │ │ ├── NamingStrategy.cs │ │ ├── ObjectConstructor.cs │ │ ├── OnErrorAttribute.cs │ │ ├── ReflectionAttributeProvider.cs │ │ ├── ReflectionValueProvider.cs │ │ ├── TraceJsonReader.cs │ │ └── TraceJsonWriter.cs │ ├── SerializationBinder.cs │ ├── StringEscapeHandling.cs │ ├── TraceLevel.cs │ ├── TypeNameHandling.cs │ ├── Utilities │ │ ├── AotHelper.cs │ │ ├── Base64Encoder.cs │ │ ├── BidirectionalDictionary.cs │ │ ├── CollectionUtils.cs │ │ ├── CollectionWrapper.cs │ │ ├── ConvertUtils.cs │ │ ├── DateTimeParser.cs │ │ ├── DateTimeUtils.cs │ │ ├── DictionaryWrapper.cs │ │ ├── DynamicProxy.cs │ │ ├── DynamicProxyMetaObject.cs │ │ ├── DynamicReflectionDelegateFactory.cs │ │ ├── DynamicUtils.cs │ │ ├── EnumUtils.cs │ │ ├── EnumValue.cs │ │ ├── ExpressionReflectionDelegateFactory.cs │ │ ├── FSharpUtils.cs │ │ ├── ILGeneratorExtensions.cs │ │ ├── ImmutableCollectionsUtils.cs │ │ ├── JavaScriptUtils.cs │ │ ├── JsonTokenUtils.cs │ │ ├── LateBoundReflectionDelegateFactory.cs │ │ ├── LinqBridge.cs │ │ ├── MathUtils.cs │ │ ├── MethodCall.cs │ │ ├── MiscellaneousUtils.cs │ │ ├── PropertyNameTable.cs │ │ ├── ReflectionDelegateFactory.cs │ │ ├── ReflectionObject.cs │ │ ├── ReflectionUtils.cs │ │ ├── StringBuffer.cs │ │ ├── StringReference.cs │ │ ├── StringUtils.cs │ │ ├── ThreadSafeStore.cs │ │ ├── TypeExtensions.cs │ │ └── ValidationUtils.cs │ ├── WriteState.cs │ └── copy_sources_from_origin.py └── UnityPackage │ ├── .gitignore │ ├── Assets │ ├── Artifacts.meta │ ├── Artifacts │ │ ├── Editor.meta │ │ └── Editor │ │ │ └── .gitignore │ ├── JsonNetSample.cs │ ├── JsonNetSample.cs.meta │ ├── JsonNetSample.unity │ ├── JsonNetSample.unity.meta │ ├── link.xml │ └── link.xml.meta │ ├── JsonNet-Lite.unitypackage.json │ ├── JsonNet.base.json │ ├── JsonNet.unitypackage.json │ └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityAdsSettings.asset │ └── UnityConnectSettings.asset └── tools ├── nuget ├── NuGet.Config ├── NuGet.targets ├── nuget.exe └── packages.config └── unity3d └── pdb2mdb.exe /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{cs, py, fsx}] 4 | indent_style = space 5 | indent_size = 4 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [*.{json, xml}] 10 | indent_style = space 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific files 2 | *.suo 3 | *.user 4 | *.userosscache 5 | *.sln.docstates 6 | 7 | # Build results 8 | [Dd]ebug/ 9 | [Dd]ebugPublic/ 10 | [Rr]elease/ 11 | [Rr]eleases/ 12 | x64/ 13 | x86/ 14 | build/ 15 | bld/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | 19 | # Coverity output 20 | cov-int/ 21 | 22 | # Visual Studio 2015 cache/options directory 23 | .vs/ 24 | 25 | # DNX 26 | project.lock.json 27 | # artifacts/ 28 | 29 | # Visual Studio profiler 30 | *.psess 31 | *.vsp 32 | *.vspx 33 | 34 | # Visual Studio Code 35 | .vscode 36 | 37 | # Click-Once directory 38 | [Pp]ublish/ 39 | 40 | # NuGet Packages 41 | *.nupkg 42 | # The packages folder can be ignored because of Package Restore 43 | **/packages/* 44 | # except build/, which is used as an MSBuild target. 45 | !**/packages/build/ 46 | # Uncomment if necessary however generally it will be regenerated when needed 47 | #!**/packages/repositories.config 48 | 49 | # Windows Azure Build Output 50 | csx/ 51 | *.build.csdef 52 | 53 | # Windows Store app package directory 54 | AppPackages/ 55 | 56 | # Visual Studio cache files 57 | # files ending in .cache can be ignored 58 | *.[Cc]ache 59 | # but keep track of directories ending in .cache 60 | !*.[Cc]ache/ 61 | 62 | # Fake 63 | .fake/ 64 | 65 | # No APK 66 | *.apk 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 SaladLab 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /NOTE.md: -------------------------------------------------------------------------------- 1 | # Note 2 | 3 | ## Assembly Size 4 | 5 | Newtonsoft Json.NET 8.0.2 6 | - NET45: Json.NET for .NET45 7 | - NET35: Json.NET for .NET35 8 | - Unity = NET35 with Unity support 9 | - UnityLite = Unity - Json.Linq - Bson 10 | 11 | | | NET45 | NET35 | Unity | UnityLite | 12 | | :--------- | ------: | ------: | ------: | --------: | 13 | | String | 66,256 | 58,372 | 44,528 | 35,448 | 14 | | Blob | 44,116 | 34,628 | 25,268 | 19,668 | 15 | | UserString | 52,736 | 47,168 | 37,632 | 28,580 | 16 | | Guid | 16 | 16 | 16 | 16 | 17 | | Table | 153,708 | 117,064 | 87,212 | 61,576 | 18 | | Method | 169,310 | 154,787 | 119,086 | 89,958 | 19 | | Etc | 35,074 | 31,357 | 21,106 | 14,098 | 20 | | Total | 521,216 | 443,392 | 334,848 | 249,344 | 21 | | Relative | 100% | 85% | 64% | 47% | 22 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 8.0.3.{build} 2 | os: Visual Studio 2015 3 | init: 4 | - git config --global core.autocrlf true 5 | test: off 6 | build_script: 7 | - cmd: build.cmd ci 8 | artifacts: 9 | - path: './bin/unity/*.unitypackage' 10 | name: UnityPackage 11 | cache: 12 | - packages -> **\packages.config 13 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | pushd %~dp0 4 | 5 | SET PACKAGEPATH=.\packages\ 6 | SET NUGET=.\tools\nuget\NuGet.exe 7 | SET NUGETOPTIONS=-ConfigFile .\tools\nuget\NuGet.Config -OutputDirectory %PACKAGEPATH% -ExcludeVersion 8 | 9 | IF NOT EXIST %PACKAGEPATH%FAKE\Ver_4.28.0 ( 10 | RD /S/Q %PACKAGEPATH%FAKE 11 | %NUGET% install FAKE -Version 4.28.0 %NUGETOPTIONS% 12 | COPY NUL %PACKAGEPATH%FAKE\Ver_4.28.0 13 | ) 14 | 15 | IF NOT EXIST %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.6 ( 16 | RD /S/Q %PACKAGEPATH%FAKE.BuildLib 17 | %NUGET% install FAKE.BuildLib -Version 0.3.6 %NUGETOPTIONS% 18 | COPY NUL %PACKAGEPATH%FAKE.BuildLib\Ver_0.3.6 19 | ) 20 | 21 | set encoding=utf-8 22 | "%PACKAGEPATH%FAKE\tools\FAKE.exe" build.fsx %* 23 | 24 | popd 25 | -------------------------------------------------------------------------------- /build.fsx: -------------------------------------------------------------------------------- 1 | #I @"packages/FAKE/tools" 2 | #I @"packages/FAKE.BuildLib/lib/net451" 3 | #r "FakeLib.dll" 4 | #r "BuildLib.dll" 5 | 6 | open Fake 7 | open Fake.FileHelper 8 | open BuildLib 9 | open System.IO 10 | 11 | let solution = 12 | initSolution 13 | "./Json.Net.Unity3D.sln" "Release" [] 14 | 15 | Target "Clean" <| fun _ -> cleanBin 16 | 17 | Target "Restore" <| fun _ -> restoreNugetPackages solution 18 | 19 | Target "Build" <| fun _ -> 20 | // Regular 21 | buildSolution solution 22 | // Lite 23 | !!solution.SolutionFile 24 | |> MSBuild "" "Rebuild" [ "Configuration", solution.Configuration + "Lite" ] 25 | |> Log "Build-Output: " 26 | 27 | 28 | Target "Test" <| fun _ -> 29 | let nunitRunnerDir = lazy ((getNugetPackage "NUnit.Runners" "2.6.4") @@ "tools") 30 | ensureDirectory testDir 31 | !! ("./src/**/bin/" + solution.Configuration + "/*.Tests.dll") 32 | |> NUnit (fun p -> 33 | {p with ToolPath = nunitRunnerDir.Force() 34 | DisableShadowCopy = true; 35 | OutputFile = testDir @@ "test.xml" }) 36 | 37 | Target "PackUnity" <| fun _ -> 38 | packUnityPackage "./src/UnityPackage/JsonNet.unitypackage.json" 39 | packUnityPackage "./src/UnityPackage/JsonNet-Lite.unitypackage.json" 40 | 41 | Target "Pack" <| fun _ -> () 42 | 43 | Target "CI" <| fun _ -> () 44 | 45 | Target "Help" <| fun _ -> 46 | showUsage solution (fun _ -> None) 47 | 48 | "Clean" 49 | ==> "Restore" 50 | ==> "Build" 51 | ==> "Test" 52 | 53 | "Build" ==> "PackUnity" 54 | "PackUnity" ==> "Pack" 55 | 56 | "Test" ==> "CI" 57 | "Pack" ==> "CI" 58 | 59 | RunTargetOrDefault "Help" 60 | -------------------------------------------------------------------------------- /docs/UnitTestResult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaladLab/Json.Net.Unity3D/1bbe0d87a9515481c1fc4f7c62ac806320081eee/docs/UnitTestResult.png -------------------------------------------------------------------------------- /docs/UnitTestSummary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaladLab/Json.Net.Unity3D/1bbe0d87a9515481c1fc4f7c62ac806320081eee/docs/UnitTestSummary.png -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/LinqToSql/Department.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | #if !(DNXCORE50 || NET20) 27 | using System; 28 | using System.Collections.Generic; 29 | using System.ComponentModel.DataAnnotations; 30 | using System.Data.Linq; 31 | using System.Linq; 32 | using System.Text; 33 | 34 | namespace Newtonsoft.Json.Tests.LinqToSql 35 | { 36 | [MetadataType(typeof(DepartmentMetadata))] 37 | public partial class Department 38 | { 39 | [JsonConverter(typeof(DepartmentConverter))] 40 | public class DepartmentMetadata 41 | { 42 | } 43 | } 44 | } 45 | 46 | #endif -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/LinqToSql/Person.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | #if !(NET20 || DNXCORE50) 27 | 28 | using System; 29 | using System.Collections.Generic; 30 | using System.ComponentModel.DataAnnotations; 31 | using System.Text; 32 | 33 | namespace Newtonsoft.Json.Tests.LinqToSql 34 | { 35 | [MetadataType(typeof(PersonMetadata))] 36 | public partial class Person 37 | { 38 | public class PersonMetadata 39 | { 40 | [JsonProperty("first_name")] 41 | public string FirstName { get; set; } 42 | } 43 | } 44 | } 45 | 46 | #endif -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/SpaceShipV2.bson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaladLab/Json.Net.Unity3D/1bbe0d87a9515481c1fc4f7c62ac806320081eee/src/Newtonsoft.Json.Tests/SpaceShipV2.bson -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Aa.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | internal class Aa 29 | { 30 | public int no; 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/AbstractGenericBase.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public abstract class AbstractGenericBase 29 | { 30 | public abstract TKey Id { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Antworten.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public enum Antworten 29 | { 30 | First, 31 | Second 32 | } 33 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ArgumentConverterPrecedenceClassConverter.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class ArgumentConverterPrecedenceClassConverter : ConverterPrecedenceClassConverter 29 | { 30 | public override string ConverterType 31 | { 32 | get { return "Argument"; } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Article.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class Article 29 | { 30 | public string Name; 31 | 32 | public Article() 33 | { 34 | } 35 | 36 | public Article(string name) 37 | { 38 | Name = name; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ArticleCollection.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class ArticleCollection : List
31 | { 32 | } 33 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/BadJsonPropertyClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class BadJsonPropertyClass 29 | { 30 | [JsonProperty("pie")] 31 | public string Pie = "Yum"; 32 | 33 | public string pie = "PieChart!"; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Bar.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class Bar 29 | { 30 | public int Id { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Bb.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | internal class Bb : Aa 29 | { 30 | public new bool no; 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Car.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.Generic; 28 | 29 | namespace Newtonsoft.Json.Tests.TestObjects 30 | { 31 | public class Car 32 | { 33 | // included in JSON 34 | public string Model { get; set; } 35 | public DateTime Year { get; set; } 36 | public List Features { get; set; } 37 | 38 | // ignored 39 | [JsonIgnore] 40 | public DateTime LastModified { get; set; } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/CircularReferenceClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class CircularReferenceClass 29 | { 30 | [JsonProperty(Required = Required.Always)] 31 | public string Name { get; set; } 32 | 33 | [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] 34 | public CircularReferenceClass Child { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/CircularReferenceWithIdClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | [JsonObject(Id = "MyExplicitId")] 29 | public class CircularReferenceWithIdClass 30 | { 31 | [JsonProperty(Required = Required.AllowNull)] 32 | public string Name { get; set; } 33 | 34 | public CircularReferenceWithIdClass Child { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ClassAndMemberConverterClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class ClassAndMemberConverterClass 29 | { 30 | public ConverterPrecedenceClass DefaultConverter { get; set; } 31 | 32 | [JsonConverter(typeof(MemberConverterPrecedenceClassConverter))] 33 | public ConverterPrecedenceClass MemberConverter { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ClassConverterPrecedenceClassConverter.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class ClassConverterPrecedenceClassConverter : ConverterPrecedenceClassConverter 29 | { 30 | public override string ConverterType 31 | { 32 | get { return "Class"; } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ClassWithGuid.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class ClassWithGuid 31 | { 32 | public Guid GuidField; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Component.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | #if !(NET35 || NET20) 29 | [JsonObject(MemberSerialization.OptIn)] 30 | public class Component 31 | { 32 | [JsonIgnore] // Ignore circular reference 33 | public GameObject GameObject { get; set; } 34 | 35 | public Component() 36 | { 37 | } 38 | } 39 | #endif 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ConstructorCaseSensitivityClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class ConstructorCaseSensitivityClass 29 | { 30 | public string param1 { get; set; } 31 | public string Param1 { get; set; } 32 | public string Param2 { get; set; } 33 | 34 | public ConstructorCaseSensitivityClass(string param1, string Param1, string param2) 35 | { 36 | this.param1 = param1; 37 | this.Param1 = Param1; 38 | Param2 = param2; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ConstructorReadonlyFields.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class ConstructorReadonlyFields 29 | { 30 | public readonly string A; 31 | public readonly int B; 32 | 33 | public ConstructorReadonlyFields(string a, int b) 34 | { 35 | A = a; 36 | B = b; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Container.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class Container 31 | { 32 | public IList In { get; set; } 33 | public IList Out { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ContentBaseClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public abstract class ContentBaseClass 29 | { 30 | } 31 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ContentSubClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class ContentSubClass : ContentBaseClass 29 | { 30 | public ContentSubClass() 31 | { 32 | } 33 | 34 | public ContentSubClass(string EasyIn) 35 | { 36 | SomeString = EasyIn; 37 | } 38 | 39 | public string SomeString { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ConverterPrecedenceClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | [JsonConverter(typeof(ClassConverterPrecedenceClassConverter))] 29 | public class ConverterPrecedenceClass 30 | { 31 | public string TestValue { get; set; } 32 | 33 | public ConverterPrecedenceClass(string testValue) 34 | { 35 | TestValue = testValue; 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/DateTimeErrorObjectCollection.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.ObjectModel; 28 | using System.Runtime.Serialization; 29 | using Newtonsoft.Json.Serialization; 30 | 31 | namespace Newtonsoft.Json.Tests.TestObjects 32 | { 33 | public class DateTimeErrorObjectCollection : Collection 34 | { 35 | [OnError] 36 | internal void OnErrorMethod(StreamingContext context, ErrorContext errorContext) 37 | { 38 | errorContext.Handled = true; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/DateTimeWrapper.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class DateTimeWrapper 31 | { 32 | public DateTime Value { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/DecimalTestClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class DecimalTestClass 29 | { 30 | public decimal Quantity { get; set; } 31 | public double OptionalQuantity { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/DefaultValueAttributeTestClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.ComponentModel; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | #if !(NETFX_CORE || DNXCORE50) 31 | [Description("DefaultValueAttributeTestClass description!")] 32 | #endif 33 | public sealed class DefaultValueAttributeTestClass 34 | { 35 | [DefaultValue("TestProperty1Value")] 36 | public string TestProperty1 { get; set; } 37 | 38 | [DefaultValue(21)] 39 | public int TestField1; 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/DoubleClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class DoubleClass 29 | { 30 | public double? Height { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/EmployeeReference.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | [JsonObject(IsReference = true)] 29 | public class EmployeeReference 30 | { 31 | public string Name { get; set; } 32 | public EmployeeReference Manager { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Event1.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.Generic; 28 | using Newtonsoft.Json.Converters; 29 | 30 | namespace Newtonsoft.Json.Tests.TestObjects 31 | { 32 | public class Event1 33 | { 34 | public string EventName { get; set; } 35 | public string Venue { get; set; } 36 | 37 | [JsonProperty(ItemConverterType = typeof(JavaScriptDateTimeConverter))] 38 | public IList Performances { get; set; } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Foo.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class Foo 31 | { 32 | public Foo() 33 | { 34 | Bars = new List(); 35 | } 36 | 37 | [JsonConverter(typeof(ListOfIds))] 38 | public List Bars { get; set; } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/GenericImpl.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class GenericImpl : AbstractGenericBase 29 | { 30 | public override int Id { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/GenericListAndDictionaryInterfaceProperties.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class GenericListAndDictionaryInterfaceProperties 31 | { 32 | public IEnumerable IEnumerableProperty { get; set; } 33 | public IList IListProperty { get; set; } 34 | public IDictionary IDictionaryProperty { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/GetOnlyPropertyClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class GetOnlyPropertyClass 29 | { 30 | public string Field = "Field"; 31 | 32 | public string GetOnlyProperty 33 | { 34 | get { return "GetOnlyProperty"; } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/IPrivateImplementationA.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public interface IPrivateImplementationA 29 | { 30 | string PropertyA { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/IPrivateImplementationB.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public interface IPrivateImplementationB 29 | { 30 | string PropertyB { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/IPrivateOverriddenImplementation.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public interface IPrivateOverriddenImplementation 29 | { 30 | object OverriddenProperty { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/IncompatibleJsonAttributeClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using Newtonsoft.Json.Converters; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | [JsonConverter(typeof(IsoDateTimeConverter))] 31 | public class IncompatibleJsonAttributeClass 32 | { 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Item.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class Item 31 | { 32 | public Guid SourceTypeID { get; set; } 33 | public Guid BrokerID { get; set; } 34 | public double Latitude { get; set; } 35 | public double Longitude { get; set; } 36 | public DateTime TimeStamp { get; set; } 37 | 38 | [JsonProperty(TypeNameHandling = TypeNameHandling.All)] 39 | public object Payload { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/JaggedArray.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class JaggedArray 29 | { 30 | public string Before { get; set; } 31 | public int[][] Coordinates { get; set; } 32 | public string After { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/JsonPropertyClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class JsonPropertyClass 29 | { 30 | [JsonProperty("pie")] 31 | public string Pie = "Yum"; 32 | 33 | [JsonIgnore] 34 | public string pie = "No pie for you!"; 35 | 36 | public string pie1 = "PieChart!"; 37 | 38 | private int _sweetCakesCount; 39 | 40 | [JsonProperty("sweet_cakes_count")] 41 | public int SweetCakesCount 42 | { 43 | get { return _sweetCakesCount; } 44 | set { _sweetCakesCount = value; } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ListErrorObjectCollection.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.ObjectModel; 27 | using System.Runtime.Serialization; 28 | using Newtonsoft.Json.Serialization; 29 | 30 | namespace Newtonsoft.Json.Tests.TestObjects 31 | { 32 | public class ListErrorObjectCollection : Collection 33 | { 34 | [OnError] 35 | internal void OnErrorMethod(StreamingContext context, ErrorContext errorContext) 36 | { 37 | errorContext.Handled = true; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ListTestClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | [JsonObject(MemberSerialization.OptIn)] 31 | public class ListTestClass 32 | { 33 | [JsonProperty] 34 | public string id { get; set; } 35 | 36 | [JsonProperty] 37 | public List items { get; set; } 38 | } 39 | 40 | [JsonObject(MemberSerialization.OptIn)] 41 | public class ListItem 42 | { 43 | [JsonProperty] 44 | public string id { get; set; } 45 | } 46 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/LogEntry.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class LogEntry 31 | { 32 | public string Details { get; set; } 33 | public DateTime LogDate { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/MemberConverterClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using Newtonsoft.Json.Converters; 28 | 29 | namespace Newtonsoft.Json.Tests.TestObjects 30 | { 31 | public class MemberConverterClass 32 | { 33 | public DateTime DefaultConverter { get; set; } 34 | 35 | [JsonConverter(typeof(IsoDateTimeConverter))] 36 | public DateTime MemberConverter { get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/MemberConverterPrecedenceClassConverter.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class MemberConverterPrecedenceClassConverter : ConverterPrecedenceClassConverter 29 | { 30 | public override string ConverterType 31 | { 32 | get { return "Member"; } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/MethodExecutorObject.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class MethodExecutorObject 29 | { 30 | public string serverClassName; 31 | public object[] serverMethodParams; 32 | public string clientGetResultFunction; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/MetroPropertyNameResolver.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Globalization; 27 | using Newtonsoft.Json.Serialization; 28 | 29 | namespace Newtonsoft.Json.Tests.TestObjects 30 | { 31 | public class MetroPropertyNameResolver : DefaultContractResolver 32 | { 33 | protected override string ResolvePropertyName(string propertyName) 34 | { 35 | #if !(NETFX_CORE || DNXCORE50) 36 | return ":::" + propertyName.ToUpper(CultureInfo.InvariantCulture) + ":::"; 37 | #else 38 | return ":::" + propertyName.ToUpper() + ":::"; 39 | #endif 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/MyClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class MyClass 29 | { 30 | public int PreProperty { get; set; } 31 | //public DateTime DateProperty { get; set; } 32 | public int PostProperty { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Name.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class Name 31 | { 32 | public string personsName; 33 | 34 | public List pNumbers = new List(); 35 | 36 | public Name(string personsName) 37 | { 38 | this.personsName = personsName; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/NonRequest.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.Generic; 28 | 29 | namespace Newtonsoft.Json.Tests.TestObjects 30 | { 31 | public class NonRequest 32 | { 33 | public Guid Sid { get; set; } 34 | public Guid Uid { get; set; } 35 | public IList FidOrder { get; set; } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/NullableDateTimeTestClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | #if !NET20 27 | using System; 28 | using System.Collections.Generic; 29 | using System.Linq; 30 | using System.Text; 31 | 32 | namespace Newtonsoft.Json.Tests.TestObjects 33 | { 34 | public class NullableDateTimeTestClass 35 | { 36 | public string PreField { get; set; } 37 | public DateTime? DateTimeField { get; set; } 38 | public DateTimeOffset? DateTimeOffsetField { get; set; } 39 | public string PostField { get; set; } 40 | } 41 | } 42 | 43 | #endif -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/NullableGuid.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class NullableGuid 31 | { 32 | public Guid? Id { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ObjectArrayPropertyTest.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class ObjectArrayPropertyTest 29 | { 30 | public string Action { get; set; } 31 | public string Method { get; set; } 32 | public object[] Data { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PersonPropertyClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class PersonPropertyClass 29 | { 30 | public Person Person { get; set; } 31 | 32 | public PersonPropertyClass() 33 | { 34 | Person = new WagePerson(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PersonReference.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Text; 28 | 29 | namespace Newtonsoft.Json.Tests.TestObjects 30 | { 31 | public class PersonReference 32 | { 33 | internal Guid Id { get; set; } 34 | public string Name { get; set; } 35 | public PersonReference Spouse { get; set; } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PersonWithPrivateConstructor.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class PersonWithPrivateConstructor 29 | { 30 | private PersonWithPrivateConstructor() 31 | { 32 | } 33 | 34 | public static PersonWithPrivateConstructor CreatePerson() 35 | { 36 | return new PersonWithPrivateConstructor(); 37 | } 38 | 39 | public string Name { get; set; } 40 | 41 | public int Age { get; set; } 42 | } 43 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PhoneNumber.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class PhoneNumber 29 | { 30 | public string phoneNumber; 31 | 32 | public PhoneNumber(string phoneNumber) 33 | { 34 | this.phoneNumber = phoneNumber; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PrivateImplementationAClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class PrivateImplementationAClass : IPrivateImplementationA 29 | { 30 | [JsonIgnore] 31 | public string PropertyA { get; set; } 32 | 33 | [JsonProperty("PropertyA")] 34 | string IPrivateImplementationA.PropertyA 35 | { 36 | get { return PropertyA; } 37 | set { PropertyA = value; } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ProductCollection.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class ProductCollection : List 31 | { 32 | } 33 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/ProductShort.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class ProductShort 31 | { 32 | public string Name; 33 | public DateTime ExpiryDate; 34 | //public decimal Price; 35 | public string[] Sizes; 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PropertyCase.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class PropertyCase 29 | { 30 | public string firstName { get; set; } 31 | public string FirstName { get; set; } 32 | public string LastName { get; set; } 33 | public string lastName { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PropertyItemConverter.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections.Generic; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class PropertyItemConverter 31 | { 32 | [JsonProperty(ItemConverterType = typeof(MetroStringConverter))] 33 | public IList Data { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PublicParameterizedConstructorTestClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class PublicParameterizedConstructorTestClass 29 | { 30 | private readonly string _name; 31 | 32 | public PublicParameterizedConstructorTestClass(string name) 33 | { 34 | _name = name; 35 | } 36 | 37 | public string Name 38 | { 39 | get { return _name; } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/PublicParameterizedConstructorWithNonPropertyParameterTestClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class PublicParameterizedConstructorWithNonPropertyParameterTestClass 29 | { 30 | private readonly string _name; 31 | 32 | public PublicParameterizedConstructorWithNonPropertyParameterTestClass(string nameParameter) 33 | { 34 | _name = nameParameter; 35 | } 36 | 37 | public string Name 38 | { 39 | get { return _name; } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/RequestOnly.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class RequestOnly 29 | { 30 | public string Request { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/RequiredMembersClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class RequiredMembersClass 31 | { 32 | [JsonProperty(Required = Required.Always)] 33 | public string FirstName { get; set; } 34 | 35 | [JsonProperty] 36 | public string MiddleName { get; set; } 37 | 38 | [JsonProperty(Required = Required.AllowNull)] 39 | public string LastName { get; set; } 40 | 41 | [JsonProperty(Required = Required.Default)] 42 | public DateTime BirthDate { get; set; } 43 | } 44 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/RoleTransfer.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public enum RoleTransferOperation 29 | { 30 | First, 31 | Second 32 | } 33 | 34 | public enum RoleTransferDirection 35 | { 36 | First, 37 | Second 38 | } 39 | 40 | public class RoleTransfer 41 | { 42 | public RoleTransferOperation Operation { get; set; } //This is enum type 43 | public string RoleName { get; set; } 44 | public RoleTransferDirection Direction { get; set; } //This is enum type 45 | } 46 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/SearchResult.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class SearchResult 29 | { 30 | public string Title { get; set; } 31 | public string Content { get; set; } 32 | public string Url { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/SelectListItem.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class SelectListItem 29 | { 30 | public string Text { get; set; } 31 | public string Value { get; set; } 32 | public bool Selected { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/SetOnlyPropertyClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class SetOnlyPropertyClass 29 | { 30 | public string Field = "Field"; 31 | 32 | public string SetOnlyProperty 33 | { 34 | set { } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/SetOnlyPropertyClass2.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class SetOnlyPropertyClass2 29 | { 30 | private object _value; 31 | 32 | public object SetOnlyProperty 33 | { 34 | set { _value = value; } 35 | } 36 | 37 | public object GetValue() 38 | { 39 | return _value; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Shortie.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class Shortie 29 | { 30 | public string Original { get; set; } 31 | public string Shortened { get; set; } 32 | public string Short { get; set; } 33 | public ShortieException Error { get; set; } 34 | } 35 | 36 | public class ShortieException 37 | { 38 | public int Code { get; set; } 39 | public string ErrorMessage { get; set; } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/StoreColor.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | [Flags] 31 | public enum StoreColor 32 | { 33 | Black = 1, 34 | Red = 2, 35 | Yellow = 4, 36 | White = 8, 37 | DarkGoldenrod = 16 38 | } 39 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/StructTest.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public struct StructTest 29 | { 30 | public string StringProperty { get; set; } 31 | public string StringField; 32 | public int IntProperty { get; set; } 33 | public int IntField; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/SubKlass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class SubKlass : SuperKlass 29 | { 30 | public string SubProp { get; set; } 31 | 32 | public SubKlass(string subprop) 33 | { 34 | SubProp = subprop; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/SuperKlass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class SuperKlass 29 | { 30 | public string SuperProp { get; set; } 31 | 32 | public SuperKlass() 33 | { 34 | SuperProp = "default superprop"; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/TestComponent.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | #if !(NET35 || NET20) 29 | [JsonObject(MemberSerialization.OptIn)] 30 | public class TestComponent : Component 31 | { 32 | [JsonProperty] 33 | public int MyProperty { get; set; } 34 | 35 | public TestComponent() 36 | { 37 | } 38 | } 39 | #endif 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/TestComponentSimple.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | [JsonObject(MemberSerialization.OptIn)] 29 | public class TestComponentSimple 30 | { 31 | [JsonProperty] 32 | public int MyProperty { get; set; } 33 | 34 | public TestComponentSimple() 35 | { 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/TestObject.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class TestObject 29 | { 30 | public TestObject() 31 | { 32 | } 33 | 34 | public TestObject(string name, byte[] data) 35 | { 36 | Name = name; 37 | Data = data; 38 | } 39 | 40 | public string Name { get; set; } 41 | public byte[] Data { get; set; } 42 | } 43 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/TypeClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class TypeClass 31 | { 32 | public Type TypeProperty { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/TypedSubHashtable.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System.Collections; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | #if !(NETFX_CORE || DNXCORE50) 31 | public class TypedSubHashtable 32 | { 33 | public string Name; 34 | public Hashtable Hash; 35 | } 36 | #endif 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/UriGuidTimeSpanTestClass.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class UriGuidTimeSpanTestClass 31 | { 32 | public Guid Guid { get; set; } 33 | public Guid? NullableGuid { get; set; } 34 | public TimeSpan TimeSpan { get; set; } 35 | public TimeSpan? NullableTimeSpan { get; set; } 36 | public Uri Uri { get; set; } 37 | } 38 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/UserNullable.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Tests.TestObjects 29 | { 30 | public class UserNullable 31 | { 32 | public Guid Id; 33 | public string FName; 34 | public string LName; 35 | public int RoleId; 36 | public int? NullableRoleId; 37 | public int? NullRoleId; 38 | public bool? Active; 39 | } 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/WagePerson.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class WagePerson : Person 29 | { 30 | [JsonProperty] 31 | public decimal HourlyWage { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Widget.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class Widget 29 | { 30 | public WidgetId? Id { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/Widget1.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class Widget1 29 | { 30 | public WidgetId1? Id { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/WidgetId.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public struct WidgetId 29 | { 30 | public string Value { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/WidgetId1.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | [JsonConverter(typeof(WidgetIdJsonConverter))] 29 | public struct WidgetId1 30 | { 31 | public long Value { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/TestObjects/WithEnums.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Tests.TestObjects 27 | { 28 | public class WithEnums 29 | { 30 | public int Id { get; set; } 31 | public MyEnum? NullableEnum { get; set; } 32 | } 33 | 34 | public enum MyEnum 35 | { 36 | Value1, 37 | Value2, 38 | Value3 39 | } 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/copy_sources_from_origin.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import xml.etree.ElementTree as ET 4 | 5 | def copy_sources_from_proj(root_path, csproj_name): 6 | csproj_path = os.path.join(root_path, csproj_name) 7 | tree = ET.parse(csproj_path) 8 | for e in tree.getroot().iter("{http://schemas.microsoft.com/developer/msbuild/2003}Compile"): 9 | if 'Include' in e.attrib: 10 | file = e.attrib['Include'] 11 | print file 12 | file_parts = os.path.split(file) 13 | if len(file_parts[0]) > 0: 14 | try: 15 | os.makedirs(file_parts[0]) 16 | except: 17 | pass 18 | shutil.copy(os.path.join(root_path, file), file) 19 | 20 | copy_sources_from_proj( 21 | r'..\..\..\Newtonsoft.Json\Src\Newtonsoft.Json.Tests', 22 | r'Newtonsoft.Json.Tests.Unity3D.csproj') 23 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/DateFormatHandling.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json 27 | { 28 | /// 29 | /// Specifies how dates are formatted when writing JSON text. 30 | /// 31 | public enum DateFormatHandling 32 | { 33 | /// 34 | /// Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". 35 | /// 36 | IsoDateFormat, 37 | 38 | /// 39 | /// Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". 40 | /// 41 | MicrosoftDateFormat 42 | } 43 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/FloatParseHandling.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json 27 | { 28 | /// 29 | /// Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. 30 | /// 31 | public enum FloatParseHandling 32 | { 33 | /// 34 | /// Floating point numbers are parsed to . 35 | /// 36 | Double = 0, 37 | 38 | /// 39 | /// Floating point numbers are parsed to . 40 | /// 41 | Decimal = 1 42 | } 43 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/FormatterAssemblyStyle.cs: -------------------------------------------------------------------------------- 1 |  2 | #if DOTNET || PORTABLE40 || PORTABLE 3 | 4 | namespace System.Runtime.Serialization.Formatters 5 | { 6 | /// 7 | /// Indicates the method that will be used during deserialization for locating and loading assemblies. 8 | /// 9 | public enum FormatterAssemblyStyle 10 | { 11 | /// 12 | /// In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method is used to load the assembly. 13 | /// 14 | Simple = 0, 15 | 16 | /// 17 | /// In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the Assembly class is used to load the assembly. 18 | /// 19 | Full = 1 20 | } 21 | } 22 | 23 | #endif -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Formatting.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json 27 | { 28 | /// 29 | /// Specifies formatting options for the . 30 | /// 31 | public enum Formatting 32 | { 33 | /// 34 | /// No special formatting is applied. This is the default. 35 | /// 36 | None = 0, 37 | 38 | /// 39 | /// Causes child objects to be indented according to the and settings. 40 | /// 41 | Indented = 1 42 | } 43 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/IArrayPool.cs: -------------------------------------------------------------------------------- 1 | namespace Newtonsoft.Json 2 | { 3 | /// 4 | /// Provides an interface for using pooled arrays. 5 | /// 6 | /// The array type content. 7 | public interface IArrayPool 8 | { 9 | /// 10 | /// Rent a array from the pool. This array must be returned when it is no longer needed. 11 | /// 12 | /// The minimum required length of the array. The returned array may be longer. 13 | /// The rented array from the pool. This array must be returned when it is no longer needed. 14 | T[] Rent(int minimumLength); 15 | 16 | /// 17 | /// Return an array to the pool. 18 | /// 19 | /// The array that is being returned. 20 | void Return(T[] array); 21 | } 22 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/JsonConstructorAttribute.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json 29 | { 30 | /// 31 | /// Instructs the to use the specified constructor when deserializing that object. 32 | /// 33 | [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)] 34 | public sealed class JsonConstructorAttribute : Attribute 35 | { 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/JsonConverterCollection.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.Generic; 28 | using System.Text; 29 | using System.Collections.ObjectModel; 30 | 31 | namespace Newtonsoft.Json 32 | { 33 | /// 34 | /// Represents a collection of . 35 | /// 36 | public class JsonConverterCollection : Collection 37 | { 38 | } 39 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/JsonExtensionDataAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Newtonsoft.Json 4 | { 5 | /// 6 | /// Instructs the to deserialize properties with no matching class member into the specified collection 7 | /// and write values during serialization. 8 | /// 9 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] 10 | public class JsonExtensionDataAttribute : Attribute 11 | { 12 | /// 13 | /// Gets or sets a value that indicates whether to write extension data when serializing the object. 14 | /// 15 | /// 16 | /// true to write extension data when serializing the object; otherwise, false. The default is true. 17 | /// 18 | public bool WriteData { get; set; } 19 | 20 | /// 21 | /// Gets or sets a value that indicates whether to read extension data when deserializing the object. 22 | /// 23 | /// 24 | /// true to read extension data when deserializing the object; otherwise, false. The default is true. 25 | /// 26 | public bool ReadData { get; set; } 27 | 28 | /// 29 | /// Initializes a new instance of the class. 30 | /// 31 | public JsonExtensionDataAttribute() 32 | { 33 | WriteData = true; 34 | ReadData = true; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/JsonIgnoreAttribute.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.Generic; 28 | using System.Text; 29 | 30 | namespace Newtonsoft.Json 31 | { 32 | /// 33 | /// Instructs the not to serialize the public field or public read/write property value. 34 | /// 35 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] 36 | public sealed class JsonIgnoreAttribute : Attribute 37 | { 38 | } 39 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/JsonRequiredAttribute.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.Generic; 28 | using System.Text; 29 | 30 | namespace Newtonsoft.Json 31 | { 32 | /// 33 | /// Instructs the to always serialize the member, and require the member has a value. 34 | /// 35 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] 36 | public sealed class JsonRequiredAttribute : Attribute 37 | { 38 | } 39 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/CommentHandling.cs: -------------------------------------------------------------------------------- 1 | #if NO_JSONLINQ 2 | 3 | // Dummy namespace 4 | namespace Newtonsoft.Json.Linq 5 | { 6 | class Dummy { } 7 | } 8 | 9 | #else 10 | 11 | namespace Newtonsoft.Json.Linq 12 | { 13 | /// 14 | /// Specifies how JSON comments are handled when loading JSON. 15 | /// 16 | public enum CommentHandling 17 | { 18 | /// 19 | /// Ignore comments. 20 | /// 21 | Ignore = 0, 22 | 23 | /// 24 | /// Load comments as a with type . 25 | /// 26 | Load = 1 27 | } 28 | 29 | /// 30 | /// Specifies how line information is handled when loading JSON. 31 | /// 32 | public enum LineInfoHandling 33 | { 34 | /// 35 | /// Ignore line information. 36 | /// 37 | Ignore = 0, 38 | 39 | /// 40 | /// Load line information. 41 | /// 42 | Load = 1 43 | } 44 | } 45 | 46 | #endif -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/JsonLoadSettings.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONLINQ 2 | 3 | using System; 4 | 5 | namespace Newtonsoft.Json.Linq 6 | { 7 | /// 8 | /// Specifies the settings used when loading JSON. 9 | /// 10 | public class JsonLoadSettings 11 | { 12 | private CommentHandling _commentHandling; 13 | private LineInfoHandling _lineInfoHandling; 14 | 15 | /// 16 | /// Gets or sets how JSON comments are handled when loading JSON. 17 | /// 18 | /// The JSON comment handling. 19 | public CommentHandling CommentHandling 20 | { 21 | get { return _commentHandling; } 22 | set 23 | { 24 | if (value < CommentHandling.Ignore || value > CommentHandling.Load) 25 | { 26 | throw new ArgumentOutOfRangeException(nameof(value)); 27 | } 28 | 29 | _commentHandling = value; 30 | } 31 | } 32 | 33 | /// 34 | /// Gets or sets how JSON line info is handled when loading JSON. 35 | /// 36 | /// The JSON line info handling. 37 | public LineInfoHandling LineInfoHandling 38 | { 39 | get { return _lineInfoHandling; } 40 | set 41 | { 42 | if (value < LineInfoHandling.Ignore || value > LineInfoHandling.Load) 43 | { 44 | throw new ArgumentOutOfRangeException(nameof(value)); 45 | } 46 | 47 | _lineInfoHandling = value; 48 | } 49 | } 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/JsonMergeSettings.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONLINQ 2 | 3 | using System; 4 | 5 | namespace Newtonsoft.Json.Linq 6 | { 7 | /// 8 | /// Specifies the settings used when merging JSON. 9 | /// 10 | public class JsonMergeSettings 11 | { 12 | private MergeArrayHandling _mergeArrayHandling; 13 | private MergeNullValueHandling _mergeNullValueHandling; 14 | 15 | /// 16 | /// Gets or sets the method used when merging JSON arrays. 17 | /// 18 | /// The method used when merging JSON arrays. 19 | public MergeArrayHandling MergeArrayHandling 20 | { 21 | get { return _mergeArrayHandling; } 22 | set 23 | { 24 | if (value < MergeArrayHandling.Concat || value > MergeArrayHandling.Merge) 25 | { 26 | throw new ArgumentOutOfRangeException(nameof(value)); 27 | } 28 | 29 | _mergeArrayHandling = value; 30 | } 31 | } 32 | 33 | /// 34 | /// Gets or sets how how null value properties are merged. 35 | /// 36 | /// How null value properties are merged. 37 | public MergeNullValueHandling MergeNullValueHandling 38 | { 39 | get { return _mergeNullValueHandling; } 40 | set 41 | { 42 | if (value < MergeNullValueHandling.Ignore || value > MergeNullValueHandling.Merge) 43 | { 44 | throw new ArgumentOutOfRangeException(nameof(value)); 45 | } 46 | 47 | _mergeNullValueHandling = value; 48 | } 49 | } 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/JsonPath/ArrayIndexFilter.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONPATH 2 | 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using Newtonsoft.Json.Utilities; 6 | 7 | namespace Newtonsoft.Json.Linq.JsonPath 8 | { 9 | internal class ArrayIndexFilter : PathFilter 10 | { 11 | public int? Index { get; set; } 12 | 13 | public override IEnumerable ExecuteFilter(IEnumerable current, bool errorWhenNoMatch) 14 | { 15 | foreach (JToken t in current) 16 | { 17 | if (Index != null) 18 | { 19 | JToken v = GetTokenIndex(t, errorWhenNoMatch, Index.GetValueOrDefault()); 20 | 21 | if (v != null) 22 | { 23 | yield return v; 24 | } 25 | } 26 | else 27 | { 28 | if (t is JArray || t is JConstructor) 29 | { 30 | foreach (JToken v in t) 31 | { 32 | yield return v; 33 | } 34 | } 35 | else 36 | { 37 | if (errorWhenNoMatch) 38 | { 39 | throw new JsonException("Index * not valid on {0}.".FormatWith(CultureInfo.InvariantCulture, t.GetType().Name)); 40 | } 41 | } 42 | } 43 | } 44 | } 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/JsonPath/ArrayMultipleIndexFilter.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONPATH 2 | 3 | using System.Collections.Generic; 4 | 5 | namespace Newtonsoft.Json.Linq.JsonPath 6 | { 7 | internal class ArrayMultipleIndexFilter : PathFilter 8 | { 9 | public List Indexes { get; set; } 10 | 11 | public override IEnumerable ExecuteFilter(IEnumerable current, bool errorWhenNoMatch) 12 | { 13 | foreach (JToken t in current) 14 | { 15 | foreach (int i in Indexes) 16 | { 17 | JToken v = GetTokenIndex(t, errorWhenNoMatch, i); 18 | 19 | if (v != null) 20 | { 21 | yield return v; 22 | } 23 | } 24 | } 25 | } 26 | } 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/JsonPath/FieldFilter.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONPATH 2 | 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using Newtonsoft.Json.Utilities; 6 | 7 | namespace Newtonsoft.Json.Linq.JsonPath 8 | { 9 | internal class FieldFilter : PathFilter 10 | { 11 | public string Name { get; set; } 12 | 13 | public override IEnumerable ExecuteFilter(IEnumerable current, bool errorWhenNoMatch) 14 | { 15 | foreach (JToken t in current) 16 | { 17 | JObject o = t as JObject; 18 | if (o != null) 19 | { 20 | if (Name != null) 21 | { 22 | JToken v = o[Name]; 23 | 24 | if (v != null) 25 | { 26 | yield return v; 27 | } 28 | else if (errorWhenNoMatch) 29 | { 30 | throw new JsonException("Property '{0}' does not exist on JObject.".FormatWith(CultureInfo.InvariantCulture, Name)); 31 | } 32 | } 33 | else 34 | { 35 | foreach (KeyValuePair p in o) 36 | { 37 | yield return p.Value; 38 | } 39 | } 40 | } 41 | else 42 | { 43 | if (errorWhenNoMatch) 44 | { 45 | throw new JsonException("Property '{0}' not valid on {1}.".FormatWith(CultureInfo.InvariantCulture, Name ?? "*", t.GetType().Name)); 46 | } 47 | } 48 | } 49 | } 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/JsonPath/FieldMultipleFilter.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONPATH 2 | 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | #if NET20 6 | using Newtonsoft.Json.Utilities.LinqBridge; 7 | #else 8 | using System.Linq; 9 | #endif 10 | using Newtonsoft.Json.Utilities; 11 | 12 | namespace Newtonsoft.Json.Linq.JsonPath 13 | { 14 | internal class FieldMultipleFilter : PathFilter 15 | { 16 | public List Names { get; set; } 17 | 18 | public override IEnumerable ExecuteFilter(IEnumerable current, bool errorWhenNoMatch) 19 | { 20 | foreach (JToken t in current) 21 | { 22 | JObject o = t as JObject; 23 | if (o != null) 24 | { 25 | foreach (string name in Names) 26 | { 27 | JToken v = o[name]; 28 | 29 | if (v != null) 30 | { 31 | yield return v; 32 | } 33 | 34 | if (errorWhenNoMatch) 35 | { 36 | throw new JsonException("Property '{0}' does not exist on JObject.".FormatWith(CultureInfo.InvariantCulture, name)); 37 | } 38 | } 39 | } 40 | else 41 | { 42 | if (errorWhenNoMatch) 43 | { 44 | throw new JsonException("Properties {0} not valid on {1}.".FormatWith(CultureInfo.InvariantCulture, string.Join(", ", Names.Select(n => "'" + n + "'").ToArray()), t.GetType().Name)); 45 | } 46 | } 47 | } 48 | } 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/JsonPath/QueryFilter.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONPATH 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace Newtonsoft.Json.Linq.JsonPath 7 | { 8 | internal class QueryFilter : PathFilter 9 | { 10 | public QueryExpression Expression { get; set; } 11 | 12 | public override IEnumerable ExecuteFilter(IEnumerable current, bool errorWhenNoMatch) 13 | { 14 | foreach (JToken t in current) 15 | { 16 | foreach (JToken v in t) 17 | { 18 | if (Expression.IsMatch(v)) 19 | { 20 | yield return v; 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/MergeArrayHandling.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONLINQ 2 | 3 | namespace Newtonsoft.Json.Linq 4 | { 5 | /// 6 | /// Specifies how JSON arrays are merged together. 7 | /// 8 | public enum MergeArrayHandling 9 | { 10 | /// Concatenate arrays. 11 | Concat = 0, 12 | 13 | /// Union arrays, skipping items that already exist. 14 | Union = 1, 15 | 16 | /// Replace all array items. 17 | Replace = 2, 18 | 19 | /// Merge array items together, matched by index. 20 | Merge = 3 21 | } 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Linq/MergeNullValueHandling.cs: -------------------------------------------------------------------------------- 1 | #if !NO_JSONLINQ 2 | 3 | using System; 4 | 5 | namespace Newtonsoft.Json.Linq 6 | { 7 | /// 8 | /// Specifies how null value properties are merged. 9 | /// 10 | [Flags] 11 | public enum MergeNullValueHandling 12 | { 13 | /// 14 | /// The content's null value properties will be ignored during merging. 15 | /// 16 | Ignore = 0, 17 | 18 | /// 19 | /// The content's null value properties will be merged. 20 | /// 21 | Merge = 1 22 | } 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Schema/JsonSchemaNodeCollection.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Collections.ObjectModel; 28 | 29 | namespace Newtonsoft.Json.Schema 30 | { 31 | [Obsolete("JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details.")] 32 | internal class JsonSchemaNodeCollection : KeyedCollection 33 | { 34 | protected override string GetKeyForItem(JsonSchemaNode item) 35 | { 36 | return item.Id; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Serialization/CachedAttributeGetter.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | using System.Reflection; 28 | using Newtonsoft.Json.Utilities; 29 | 30 | namespace Newtonsoft.Json.Serialization 31 | { 32 | internal static class CachedAttributeGetter where T : Attribute 33 | { 34 | private static readonly ThreadSafeStore TypeAttributeCache = new ThreadSafeStore(JsonTypeReflector.GetAttribute); 35 | 36 | public static T GetAttribute(object type) 37 | { 38 | return TypeAttributeCache.Get(type); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Serialization/CamelCaseNamingStrategy.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Utilities; 2 | 3 | namespace Newtonsoft.Json.Serialization 4 | { 5 | /// 6 | /// A camel case naming strategy. 7 | /// 8 | public class CamelCaseNamingStrategy : NamingStrategy 9 | { 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | /// 14 | /// A flag indicating whether dictionary keys should be processed. 15 | /// 16 | /// 17 | /// A flag indicating whether explicitly specified property names should be processed, 18 | /// e.g. a property name customized with a . 19 | /// 20 | public CamelCaseNamingStrategy(bool processDictionaryKeys, bool overrideSpecifiedNames) 21 | { 22 | ProcessDictionaryKeys = processDictionaryKeys; 23 | OverrideSpecifiedNames = overrideSpecifiedNames; 24 | } 25 | 26 | /// 27 | /// Initializes a new instance of the class. 28 | /// 29 | public CamelCaseNamingStrategy() 30 | { 31 | } 32 | 33 | /// 34 | /// Resolves the specified property name. 35 | /// 36 | /// The property name to resolve. 37 | /// The resolved property name. 38 | protected override string ResolvePropertyName(string name) 39 | { 40 | return StringUtils.ToCamelCase(name); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Serialization/ITraceWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | 5 | namespace Newtonsoft.Json.Serialization 6 | { 7 | /// 8 | /// Represents a trace writer. 9 | /// 10 | public interface ITraceWriter 11 | { 12 | /// 13 | /// Gets the that will be used to filter the trace messages passed to the writer. 14 | /// For example a filter level of Info will exclude Verbose messages and include Info, 15 | /// Warning and Error messages. 16 | /// 17 | /// The that will be used to filter the trace messages passed to the writer. 18 | TraceLevel LevelFilter { get; } 19 | 20 | /// 21 | /// Writes the specified trace level, message and optional exception. 22 | /// 23 | /// The at which to write this trace. 24 | /// The trace message. 25 | /// The trace exception. This parameter is optional. 26 | void Trace(TraceLevel level, string message, Exception ex); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Serialization/ObjectConstructor.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Serialization 27 | { 28 | /// 29 | /// Represents a method that constructs an object. 30 | /// 31 | /// The object type to create. 32 | public delegate object ObjectConstructor(params object[] args); 33 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Serialization/OnErrorAttribute.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Serialization 29 | { 30 | /// 31 | /// When applied to a method, specifies that the method is called when an error occurs serializing an object. 32 | /// 33 | [AttributeUsage(AttributeTargets.Method, Inherited = false)] 34 | public sealed class OnErrorAttribute : Attribute 35 | { 36 | } 37 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/SerializationBinder.cs: -------------------------------------------------------------------------------- 1 |  2 | #if (DOTNET || PORTABLE40 || PORTABLE) 3 | using System; 4 | using System.Reflection; 5 | 6 | namespace Newtonsoft.Json 7 | { 8 | /// 9 | /// Allows users to control class loading and mandate what class to load. 10 | /// 11 | public abstract class SerializationBinder 12 | { 13 | /// 14 | /// When overridden in a derived class, controls the binding of a serialized object to a type. 15 | /// 16 | /// Specifies the name of the serialized object. 17 | /// Specifies the name of the serialized object 18 | /// The type of the object the formatter creates a new instance of. 19 | public abstract Type BindToType(string assemblyName, string typeName); 20 | 21 | /// 22 | /// When overridden in a derived class, controls the binding of a serialized object to a type. 23 | /// 24 | /// The type of the object the formatter creates a new instance of. 25 | /// Specifies the name of the serialized object. 26 | /// Specifies the name of the serialized object. 27 | public virtual void BindToName(Type serializedType, out string assemblyName, out string typeName) 28 | { 29 | assemblyName = null; 30 | typeName = null; 31 | } 32 | } 33 | } 34 | 35 | #endif -------------------------------------------------------------------------------- /src/Newtonsoft.Json/TraceLevel.cs: -------------------------------------------------------------------------------- 1 |  2 | #if (DOTNET || PORTABLE40 || PORTABLE) 3 | using Newtonsoft.Json.Serialization; 4 | 5 | namespace Newtonsoft.Json 6 | { 7 | /// 8 | /// Specifies what messages to output for the class. 9 | /// 10 | public enum TraceLevel 11 | { 12 | /// 13 | /// Output no tracing and debugging messages. 14 | /// 15 | Off = 0, 16 | 17 | /// 18 | /// Output error-handling messages. 19 | /// 20 | Error = 1, 21 | 22 | /// 23 | /// Output warnings and error-handling messages. 24 | /// 25 | Warning = 2, 26 | 27 | /// 28 | /// Output informational messages, warnings, and error-handling messages. 29 | /// 30 | Info = 3, 31 | 32 | /// 33 | /// Output all debugging and tracing messages. 34 | /// 35 | Verbose = 4 36 | } 37 | } 38 | 39 | #endif -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Utilities/EnumValue.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Utilities 27 | { 28 | internal class EnumValue where T : struct 29 | { 30 | private readonly string _name; 31 | private readonly T _value; 32 | 33 | public string Name 34 | { 35 | get { return _name; } 36 | } 37 | 38 | public T Value 39 | { 40 | get { return _value; } 41 | } 42 | 43 | public EnumValue(string name, T value) 44 | { 45 | _name = name; 46 | _value = value; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Utilities/MethodCall.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | namespace Newtonsoft.Json.Utilities 27 | { 28 | internal delegate TResult MethodCall(T target, params object[] args); 29 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/Utilities/ValidationUtils.cs: -------------------------------------------------------------------------------- 1 | #region License 2 | // Copyright (c) 2007 James Newton-King 3 | // 4 | // Permission is hereby granted, free of charge, to any person 5 | // obtaining a copy of this software and associated documentation 6 | // files (the "Software"), to deal in the Software without 7 | // restriction, including without limitation the rights to use, 8 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the 10 | // Software is furnished to do so, subject to the following 11 | // conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be 14 | // included in all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | // OTHER DEALINGS IN THE SOFTWARE. 24 | #endregion 25 | 26 | using System; 27 | 28 | namespace Newtonsoft.Json.Utilities 29 | { 30 | internal static class ValidationUtils 31 | { 32 | public static void ArgumentNotNull(object value, string parameterName) 33 | { 34 | if (value == null) 35 | { 36 | throw new ArgumentNullException(parameterName); 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /src/Newtonsoft.Json/copy_sources_from_origin.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import xml.etree.ElementTree as ET 4 | 5 | def copy_sources_from_proj(root_path, csproj_name): 6 | csproj_path = os.path.join(root_path, csproj_name) 7 | tree = ET.parse(csproj_path) 8 | for e in tree.getroot().iter("{http://schemas.microsoft.com/developer/msbuild/2003}Compile"): 9 | if 'Include' in e.attrib: 10 | file = e.attrib['Include'] 11 | print file 12 | file_parts = os.path.split(file) 13 | if len(file_parts[0]) > 0: 14 | try: 15 | os.makedirs(file_parts[0]) 16 | except: 17 | pass 18 | try: 19 | shutil.copy(os.path.join(root_path, file), file) 20 | except Exception as e: 21 | print "!!!", e 22 | 23 | copy_sources_from_proj( 24 | r'..\..\..\Newtonsoft.Json\Src\Newtonsoft.Json', 25 | r'Newtonsoft.Json.Unity3D.csproj') 26 | -------------------------------------------------------------------------------- /src/UnityPackage/.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Oo]utput/ 5 | /[Bb]uild/ 6 | 7 | # Autogenerated VS/MD solution and project files 8 | *.csproj 9 | *.unityproj 10 | *.sln 11 | *.suo 12 | *.tmp 13 | *.user 14 | *.userprefs 15 | *.pidb 16 | *.booproj 17 | 18 | # Unity3D generated meta files 19 | *.pidb.meta 20 | 21 | # Unity3D Generated File On Crash Reports 22 | sysinfo.txt 23 | 24 | # UnityPackage 25 | *.unitypackage 26 | 27 | # Artifacts generated when build 28 | Assets/Artifacts/Newtonsoft.Json.* 29 | Assets/Artifacts/Editor/Newtonsoft.Json.* 30 | SpaceShipV2.bson 31 | large.json 32 | -------------------------------------------------------------------------------- /src/UnityPackage/Assets/Artifacts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c69e01622caf5274a941b8cf5e828884 3 | folderAsset: yes 4 | timeCreated: 1461512499 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/UnityPackage/Assets/Artifacts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e40bda3c7482ebd4cb3f1531574a7581 3 | folderAsset: yes 4 | timeCreated: 1467242850 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /src/UnityPackage/Assets/Artifacts/Editor/.gitignore: -------------------------------------------------------------------------------- 1 | # Stub -------------------------------------------------------------------------------- /src/UnityPackage/Assets/JsonNetSample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f30dac2bcee81e4c8d946311b78cad6 3 | timeCreated: 1447633654 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /src/UnityPackage/Assets/JsonNetSample.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bf5b6f1bd17c21409150a2bb19c8cfd 3 | timeCreated: 1447633647 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/UnityPackage/Assets/link.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fecf4b02bf52abe4a9735f9eebbf86c2 3 | timeCreated: 1461458724 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /src/UnityPackage/JsonNet-Lite.unitypackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "#base": "JsonNet.base.json", 3 | "id": "JsonNet-Lite", 4 | "files": [ 5 | "../Newtonsoft.Json/bin/ReleaseLite/Newtonsoft.Json.dll" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /src/UnityPackage/JsonNet.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "9.0.1", 3 | "authors": [ "James Newton-King" ], 4 | "owners": [ "Esun Kim" ], 5 | "description": "Unity3D port of Json.NET which is a popular high-performance JSON framework for .NET" 6 | } 7 | -------------------------------------------------------------------------------- /src/UnityPackage/JsonNet.unitypackage.json: -------------------------------------------------------------------------------- 1 | { 2 | "#base": "JsonNet.base.json", 3 | "id": "JsonNet", 4 | "files": [ 5 | "../Newtonsoft.Json/bin/Release/Newtonsoft.Json.dll", 6 | { "source": "Assets/JsonNetSample*", "target": "$homebase$/JsonNetSample/", "extra": true } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_SolverIterationCount: 6 13 | m_QueriesHitTriggers: 1 14 | m_EnableAdaptiveForce: 0 15 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 16 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/JsonNetSample.unity 10 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 1 12 | m_SpritePackerMode: 2 13 | m_SpritePackerPaddingPower: 1 14 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 15 | m_ProjectGenerationRootNamespace: 16 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_LegacyDeferred: 14 | m_Mode: 1 15 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 16 | m_AlwaysIncludedShaders: 17 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 18 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 19 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 20 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 21 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 22 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 23 | m_PreloadedShaders: [] 24 | m_ShaderSettings: 25 | useScreenSpaceShadows: 1 26 | m_BuildTargetShaderSettings: [] 27 | m_LightmapStripping: 0 28 | m_FogStripping: 0 29 | m_LightmapKeepPlain: 1 30 | m_LightmapKeepDirCombined: 1 31 | m_LightmapKeepDirSeparate: 1 32 | m_LightmapKeepDynamicPlain: 1 33 | m_LightmapKeepDynamicDirCombined: 1 34 | m_LightmapKeepDynamicDirSeparate: 1 35 | m_FogKeepLinear: 1 36 | m_FogKeepExp: 1 37 | m_FogKeepExp2: 1 38 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_MinPenetrationForPenalty: 0.01 17 | m_BaumgarteScale: 0.2 18 | m_BaumgarteTimeOfImpactScale: 0.75 19 | m_TimeToSleep: 0.5 20 | m_LinearSleepTolerance: 0.01 21 | m_AngularSleepTolerance: 2 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 26 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.3.5f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!292 &1 4 | UnityAdsSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_InitializeOnStartup: 1 8 | m_TestMode: 0 9 | m_EnabledPlatforms: 4294967295 10 | m_IosGameId: 11 | m_AndroidGameId: 12 | -------------------------------------------------------------------------------- /src/UnityPackage/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | UnityPurchasingSettings: 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | UnityAnalyticsSettings: 10 | m_Enabled: 0 11 | m_InitializeOnStartup: 1 12 | m_TestMode: 0 13 | m_TestEventUrl: 14 | m_TestConfigUrl: 15 | -------------------------------------------------------------------------------- /tools/nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tools/nuget/nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaladLab/Json.Net.Unity3D/1bbe0d87a9515481c1fc4f7c62ac806320081eee/tools/nuget/nuget.exe -------------------------------------------------------------------------------- /tools/nuget/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /tools/unity3d/pdb2mdb.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaladLab/Json.Net.Unity3D/1bbe0d87a9515481c1fc4f7c62ac806320081eee/tools/unity3d/pdb2mdb.exe --------------------------------------------------------------------------------