Permalink
Browse files

Support wellknown collection interfaces, 1.3.0

  • Loading branch information...
1 parent 4795db7 commit 853a0d0c6b7de66b8447b426ab47b90336deca2c @neuecc committed Nov 13, 2016
Showing with 1,804 additions and 975 deletions.
  1. +209 −56 README.md
  2. +0 −9 ZeroFormatter.sln
  3. BIN nuget/Unity_Releases_1.2.1.zip
  4. BIN nuget/Unity_Releases_1.3.0.zip
  5. BIN nuget/ZeroFormatter.1.2.1.nupkg
  6. BIN nuget/ZeroFormatter.Analyzer.1.0.7.0.nupkg
  7. +2 −2 nuget/ZeroFormatter.Analyzer.nuspec
  8. BIN nuget/ZeroFormatter.Interfaces.1.2.1.nupkg
  9. +2 −2 nuget/ZeroFormatter.Interfaces.nuspec
  10. BIN nuget/ZeroFormatter.Unity.1.2.1.nupkg
  11. +2 −2 nuget/ZeroFormatter.Unity.nuspec
  12. +4 −4 nuget/ZeroFormatter.nuspec
  13. +4 −4 nuget/push.bat
  14. BIN nuget/zfc.exe
  15. +1 −1 sandbox/PerformanceComparison/FlatBuffers/ByteBuffer.cs
  16. +2 −2 sandbox/PerformanceComparison/Properties/AssemblyInfo.cs
  17. +3 −3 sandbox/Sandbox.NETCore/project.json
  18. +7 −7 sandbox/Sandbox.NETCore/project.lock.json
  19. +50 −0 sandbox/Sandbox.Shared/AllNewFormat.cs
  20. +2 −2 sandbox/Sandbox.Shared/Properties/AssemblyInfo.cs
  21. +7 −0 sandbox/Sandbox.Shared/Sandbox.Shared.csproj
  22. +7 −2 sandbox/Sandbox.Shared/UnionType.cs
  23. +1 −0 sandbox/Sandbox.Shared/ZeroFormatterAnalyzer.json
  24. +4 −0 sandbox/Sandbox.Shared/packages.config
  25. +22 −0 sandbox/Sandbox/Program.cs
  26. +2 −2 sandbox/Sandbox/Properties/AssemblyInfo.cs
  27. +1 −1 src/ZeroFormatter.Analyzer.Vsix/source.extension.vsixmanifest
  28. +2 −2 src/ZeroFormatter.Analyzer/Properties/AssemblyInfo.cs
  29. +12 −0 src/ZeroFormatter.Analyzer/RoslynExtensions.cs
  30. +26 −12 src/ZeroFormatter.Analyzer/ZeroFormatterAnalyzer.cs
  31. +0 −12 src/ZeroFormatter.CodeGenerator/App.config
  32. +5 −2 src/ZeroFormatter.CodeGenerator/GeneratorPartial.cs
  33. +8 −2 src/ZeroFormatter.CodeGenerator/InitializerGenerator.tt
  34. +99 −57 src/ZeroFormatter.CodeGenerator/InitializerGenerator1.cs
  35. +5 −2 src/ZeroFormatter.CodeGenerator/Program.cs
  36. +2 −2 src/ZeroFormatter.CodeGenerator/Properties/AssemblyInfo.cs
  37. +12 −0 src/ZeroFormatter.CodeGenerator/RoslynExtensions.cs
  38. +44 −12 src/ZeroFormatter.CodeGenerator/TypeCollector.cs
  39. +1 −1 src/ZeroFormatter.CodeGenerator/ZeroFormatter.CodeGenerator.csproj
  40. +1 −1 src/ZeroFormatter.Interfaces.NETCore/project.json
  41. +1 −1 src/ZeroFormatter.Interfaces/Attributes.cs
  42. +2 −2 src/ZeroFormatter.Interfaces/Properties/AssemblyInfo.cs
  43. +2 −2 src/ZeroFormatter.NETCore/project.json
  44. +3 −3 src/ZeroFormatter.NETCore/project.lock.json
  45. +15 −12 src/ZeroFormatter/Comparers/ZeroFormatterEqualityComparer.cs
  46. +0 −226 src/ZeroFormatter/Formatters/DictionaryFormatter.cs
  47. +32 −6 src/ZeroFormatter/Formatters/{DynamicObjectFormatter.cs → DynamicFormatter.cs}
  48. +89 −28 src/ZeroFormatter/Formatters/Formatter.cs
  49. +118 −0 src/ZeroFormatter/Formatters/LazyDictionaryFormatter.cs
  50. +70 −0 src/ZeroFormatter/Formatters/LazyLookupFormatter.cs
  51. +0 −131 src/ZeroFormatter/Formatters/LookupFormatter.cs
  52. +485 −32 src/ZeroFormatter/Formatters/SequenceFormatter.cs
  53. +3 −1 src/ZeroFormatter/Formatters/StringFormatter.cs
  54. +2 −2 src/ZeroFormatter/Properties/AssemblyInfo.cs
  55. +17 −86 src/ZeroFormatter/Segments/DictionarySegment.cs
  56. +15 −96 src/ZeroFormatter/Segments/LookupSegment.cs
  57. +3 −3 src/ZeroFormatter/ZeroFormatter.csproj
  58. +1 −1 src/ZeroFormatter/ZeroFormatterSerializer.cs
  59. +1 −1 tests/ZeroFormatter.NETCore.Tests/DictionarySegmentTest.cs
  60. +3 −3 tests/ZeroFormatter.NETCore.Tests/LookupSegmentTest.cs
  61. +4 −4 tests/ZeroFormatter.NETCore.Tests/project.json
  62. +6 −6 tests/ZeroFormatter.NETCore.Tests/project.lock.json
  63. +1 −55 tests/ZeroFormatter.Tests/DictionarySegmentTest.cs
  64. +2 −6 tests/ZeroFormatter.Tests/LookupSegmentTest.cs
  65. +2 −2 tests/ZeroFormatter.Tests/Properties/AssemblyInfo.cs
  66. +40 −0 tests/ZeroFormatter.Tests/SequenceFormatterTest.cs
  67. +85 −0 tests/ZeroFormatter.Tests/VersiongTest.cs
  68. BIN tests/ZeroFormatter.UnityTests/Assets/Dlls/Sandbox.Shared.dll
  69. BIN tests/ZeroFormatter.UnityTests/Assets/Dlls/ZeroFormatter.Interfaces.dll
  70. BIN tests/ZeroFormatter.UnityTests/Assets/Dlls/ZeroFormatter.Interfaces.dll.mdb
  71. +1 −1 tests/ZeroFormatter.UnityTests/Assets/Dlls/ZeroFormatter.Interfaces.dll.mdb.meta
  72. BIN tests/ZeroFormatter.UnityTests/Assets/Dlls/ZeroFormatter.dll
  73. BIN tests/ZeroFormatter.UnityTests/Assets/Dlls/ZeroFormatter.dll.mdb
  74. +1 −1 tests/ZeroFormatter.UnityTests/Assets/Dlls/ZeroFormatter.dll.mdb.meta
  75. +0 −9 tests/ZeroFormatter.UnityTests/Assets/Editor/Pdb2Mdb.meta
  76. +2 −33 tests/ZeroFormatter.UnityTests/Assets/Scripts/Tests/DictionarySegmentTest.cs
  77. +2 −6 tests/ZeroFormatter.UnityTests/Assets/Scripts/Tests/LookupSegmentTest.cs
  78. +1 −1 tests/ZeroFormatter.UnityTests/Assets/ZeroFormatterGenerated.Additional.cs
  79. +234 −0 tests/ZeroFormatter.UnityTests/Assets/ZeroFormatterGenerated.cs
  80. BIN tests/ZeroFormatter.UnityTests/ProjectSettings/ProjectSettings.asset
  81. +1 −1 tests/ZeroFormatter.UnityTests/ProjectSettings/ProjectVersion.txt
  82. +11 −10 tests/ZeroFormatter.UnityTests/ZeroFormatter.UnityTests.CSharp.csproj
View
Oops, something went wrong.
View
@@ -34,8 +34,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{4A106901
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZeroFormatter.Tests", "tests\ZeroFormatter.Tests\ZeroFormatter.Tests.csproj", "{419EF6DC-7A15-4B50-88A4-E2AEDB73FA7F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZeroFormatter.UnityTests.CSharp", "tests\ZeroFormatter.UnityTests\ZeroFormatter.UnityTests.CSharp.csproj", "{5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox", "sandbox\Sandbox\Sandbox.csproj", "{C8BA4A0F-5F66-442A-9516-D3E94C1E26F3}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ZeroFormatter.Interfaces.NETCore", "src\ZeroFormatter.Interfaces.NETCore\ZeroFormatter.Interfaces.NETCore.xproj", "{E486CA99-A9FC-4B7D-9FB5-38A53C995C87}"
@@ -93,12 +91,6 @@ Global
{419EF6DC-7A15-4B50-88A4-E2AEDB73FA7F}.Release|Any CPU.Build.0 = Release|Any CPU
{419EF6DC-7A15-4B50-88A4-E2AEDB73FA7F}.Unity|Any CPU.ActiveCfg = Unity|Any CPU
{419EF6DC-7A15-4B50-88A4-E2AEDB73FA7F}.Unity|Any CPU.Build.0 = Unity|Any CPU
- {5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6}.Release|Any CPU.Build.0 = Release|Any CPU
- {5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6}.Unity|Any CPU.ActiveCfg = Unity|Any CPU
- {5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6}.Unity|Any CPU.Build.0 = Unity|Any CPU
{C8BA4A0F-5F66-442A-9516-D3E94C1E26F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8BA4A0F-5F66-442A-9516-D3E94C1E26F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8BA4A0F-5F66-442A-9516-D3E94C1E26F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -152,7 +144,6 @@ Global
{00F36123-EEEC-4428-89BD-848FC968B520} = {2CE059FD-1C8D-49B7-851E-4A5B385F63D5}
{C051F473-427F-4062-94FB-CAE3FA460FC8} = {2CE059FD-1C8D-49B7-851E-4A5B385F63D5}
{419EF6DC-7A15-4B50-88A4-E2AEDB73FA7F} = {4A106901-0A11-4D37-B5E6-D4DB7A43C41C}
- {5B7112AD-AFC5-CE09-8B76-781C0B4AA0F6} = {4A106901-0A11-4D37-B5E6-D4DB7A43C41C}
{C8BA4A0F-5F66-442A-9516-D3E94C1E26F3} = {F29BFD74-5462-485D-851E-69B683F08C84}
{E486CA99-A9FC-4B7D-9FB5-38A53C995C87} = {2CE059FD-1C8D-49B7-851E-4A5B385F63D5}
{C6B8E59E-ECF2-4AE9-A8F7-02E9BDAD57EB} = {2CE059FD-1C8D-49B7-851E-4A5B385F63D5}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>ZeroFormatter.Analyzer</id>
- <version>1.0.7.0</version>
+ <version>1.0.8.0</version>
<title>ZeroFormatter.Analyzer</title>
<authors>neuecc</authors>
<owners>y.neuecc</owners>
<projectUrl>https://github.com/neuecc/ZeroFormatter/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Analyzer of ZeroFormatter, verify rule for [ZeroFormattable] classes.</description>
- <releaseNotes>Support 1.2 WireFormat.</releaseNotes>
+ <releaseNotes>Support 1.3 WireFormat.</releaseNotes>
<tags>ZeroFormatter, analyzers</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" targetFramework="" />
Binary file not shown.
@@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>ZeroFormatter.Interfaces</id>
- <version>1.2.1</version>
+ <version>1.3.0</version>
<title>ZeroFormatter.Interfaces</title>
<authors>neuecc</authors>
<owners>y.neuecc</owners>
<projectUrl>https://github.com/neuecc/ZeroFormatter/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Plain interfaces and KeyTuple of ZeroFormatter, it is used for define serializable targets.</description>
- <releaseNotes>Support Union wireformat.</releaseNotes>
+ <releaseNotes>Support wellknown interface collections.</releaseNotes>
<tags>ZeroFormatter, Serialization, Formatter, Serializer</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" targetFramework=".NETFramework3.5" />
Binary file not shown.
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>ZeroFormatter.Unity</id>
- <version>1.2.1</version>
+ <version>1.3.0</version>
<title>ZeroFormatter.Unity</title>
<authors>neuecc</authors>
<owners>y.neuecc</owners>
@@ -17,7 +17,7 @@
</frameworkAssemblies>
<dependencies>
<group targetFramework="Unity Full v3.5">
- <dependency id="ZeroFormatter.Interfaces" version="1.2.1" />
+ <dependency id="ZeroFormatter.Interfaces" version="1.3.0" />
</group>
</dependencies>
</metadata>
@@ -2,25 +2,25 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>ZeroFormatter</id>
- <version>1.2.1</version>
+ <version>1.3.0</version>
<title>ZeroFormatter</title>
<authors>neuecc</authors>
<owners>y.neuecc</owners>
<projectUrl>https://github.com/neuecc/ZeroFormatter/</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Infinitly fast serializer for .NET, .NET Core and Unity.</description>
- <releaseNotes>Support Union wireformat.</releaseNotes>
+ <releaseNotes>Support wellknown interface collections.</releaseNotes>
<tags>ZeroFormatter, Serialization, Formatter, Serializer</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.5" />
<frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.5" />
</frameworkAssemblies>
<dependencies>
<group targetFramework=".NETFramework4.5">
- <dependency id="ZeroFormatter.Interfaces" version="1.2.1" />
+ <dependency id="ZeroFormatter.Interfaces" version="1.3.0" />
</group>
<group targetFramework=".NETStandard1.6">
- <dependency id="ZeroFormatter.Interfaces" version="1.2.1" />
+ <dependency id="ZeroFormatter.Interfaces" version="1.3.0" />
<dependency id="System.Reflection.Emit" version="4.0.1" />
<dependency id="System.Runtime" version="4.1.0" />
<dependency id="System.Runtime.Extensions" version="4.1.0" />
View
@@ -1,4 +1,4 @@
-REM nuget push ZeroFormatter.Analyzer.1.0.7.0.nupkg -Source https://www.nuget.org/api/v2/package
-nuget push ZeroFormatter.1.2.1.nupkg -Source https://www.nuget.org/api/v2/package
-nuget push ZeroFormatter.Interfaces.1.2.1.nupkg -Source https://www.nuget.org/api/v2/package
-nuget push ZeroFormatter.Unity.1.2.1.nupkg -Source https://www.nuget.org/api/v2/package
+nuget push ZeroFormatter.Analyzer.1.0.8.0.nupkg -Source https://www.nuget.org/api/v2/package
+nuget push ZeroFormatter.1.3.0.nupkg -Source https://www.nuget.org/api/v2/package
+nuget push ZeroFormatter.Interfaces.1.3.0.nupkg -Source https://www.nuget.org/api/v2/package
+nuget push ZeroFormatter.Unity.1.3.0.nupkg -Source https://www.nuget.org/api/v2/package
View
Binary file not shown.
@@ -435,7 +435,7 @@ public float GetFloat(int index)
public double GetDouble(int index)
{
ulong i = ReadLittleEndian(index, sizeof(double));
- // There's Int64BitsToDouble but it uses unsafe code internally.
+ // There's Int64Bits To Double but it uses unsafe code internally.
ulonghelper[0] = i;
Buffer.BlockCopy(ulonghelper, 0, doublehelper, 0, sizeof(double));
return doublehelper[0];
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.1.0")]
-[assembly: AssemblyFileVersion("1.2.1.0")]
+[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyFileVersion("1.3.0.0")]
@@ -1,5 +1,5 @@
{
- "version": "1.2.1-*",
+ "version": "1.3.0-*",
"buildOptions": {
"emitEntryPoint": true
},
@@ -9,8 +9,8 @@
"type": "platform",
"version": "1.0.0"
},
- "ZeroFormatter.Interfaces.NETCore": "1.2.1",
- "ZeroFormatter.NETCore": "1.2.1"
+ "ZeroFormatter.Interfaces.NETCore": "1.3.0",
+ "ZeroFormatter.NETCore": "1.3.0"
},
"frameworks": {
@@ -1992,7 +1992,7 @@
"lib/netstandard1.3/_._": {}
}
},
- "ZeroFormatter.Interfaces.NETCore/1.2.1": {
+ "ZeroFormatter.Interfaces.NETCore/1.3.0": {
"type": "project",
"framework": ".NETStandard,Version=v1.1",
"dependencies": {
@@ -2006,7 +2006,7 @@
"netstandard1.1/ZeroFormatter.Interfaces.NETCore.dll": {}
}
},
- "ZeroFormatter.NETCore/1.2.1": {
+ "ZeroFormatter.NETCore/1.3.0": {
"type": "project",
"framework": ".NETStandard,Version=v1.6",
"dependencies": {
@@ -2024,7 +2024,7 @@
"System.Text.Encoding": "4.0.11",
"System.Text.Encoding.Extensions": "4.0.11",
"System.Threading": "4.0.11",
- "ZeroFormatter.Interfaces.NETCore": "1.2.1"
+ "ZeroFormatter.Interfaces.NETCore": "1.3.0"
},
"compile": {
"netstandard1.6/ZeroFormatter.NETCore.dll": {}
@@ -6627,12 +6627,12 @@
"ref/xamarinwatchos10/_._"
]
},
- "ZeroFormatter.Interfaces.NETCore/1.2.1": {
+ "ZeroFormatter.Interfaces.NETCore/1.3.0": {
"type": "project",
"path": "../../src/ZeroFormatter.Interfaces.NETCore/project.json",
"msbuildProject": "../../src/ZeroFormatter.Interfaces.NETCore/ZeroFormatter.Interfaces.NETCore.xproj"
},
- "ZeroFormatter.NETCore/1.2.1": {
+ "ZeroFormatter.NETCore/1.3.0": {
"type": "project",
"path": "../../src/ZeroFormatter.NETCore/project.json",
"msbuildProject": "../../src/ZeroFormatter.NETCore/ZeroFormatter.NETCore.xproj"
@@ -6641,8 +6641,8 @@
"projectFileDependencyGroups": {
"": [
"Microsoft.NETCore.App >= 1.0.0",
- "ZeroFormatter.Interfaces.NETCore >= 1.2.1",
- "ZeroFormatter.NETCore >= 1.2.1"
+ "ZeroFormatter.Interfaces.NETCore >= 1.3.0",
+ "ZeroFormatter.NETCore >= 1.3.0"
],
".NETCoreApp,Version=v1.0": []
},
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
using ZeroFormatter;
using ZeroFormatter.Tests;
@@ -52,4 +54,52 @@ public class CustomFormat
[Index(0)]
public virtual Guid AllowGuid { get; set; }
}
+
+
+
+#pragma warning disable ZeroFormatterAnalyzer_TypeMustBeZeroFormattable // Lint of ZeroFormattable Type.
+
+ [ZeroFormattable]
+ public class SequenceFormat
+ {
+ [Index(0)]
+ public virtual MyStructFixed[] ArrayFormat { get; set; }
+ [Index(1)]
+ public virtual List<int> CollectionFormat { get; set; }
+ [Index(2)]
+ public virtual ReadOnlyCollection<int> ReadOnlyCollectionFormat { get; set; }
+ [Index(3)]
+ public virtual Dictionary<int, int> DictionaryFormat { get; set; }
+ [Index(4)]
+ public virtual IDictionary<int, int> InterafceDictionaryFormat { get; set; }
+ [Index(5)]
+
+ public virtual ICollection<int> InterfaceCollectionFormat { get; set; }
+
+ [Index(6)]
+ public virtual IEnumerable<int> InterfaceEnumerableFormat { get; set; }
+
+#if !UNITY
+
+ [Index(7)]
+ public virtual ISet<int> InterfaceSetFormat { get; set; }
+ [Index(8)]
+ public virtual IReadOnlyCollection<int> InterfaceReadOnlyCollectionFormat { get; set; }
+ [Index(9)]
+ public virtual ReadOnlyDictionary<int, int> ReadOnlyDictionaryFormat { get; set; }
+ [Index(10)]
+ public virtual IReadOnlyDictionary<int, int> InterfaceReadOnlyDictionaryFormat { get; set; }
+
+#endif
+
+
+ [Index(11)]
+ public virtual ILookup<bool, int> LookupFormat { get; set; }
+
+
+#pragma warning restore ZeroFormatterAnalyzer_TypeMustBeZeroFormattable // Lint of ZeroFormattable Type.
+ }
+
}
+
+
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.1.0")]
-[assembly: AssemblyFileVersion("1.2.1.0")]
+[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyFileVersion("1.3.0.0")]
@@ -65,6 +65,13 @@
<Name>ZeroFormatter.Interfaces</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ <AdditionalFiles Include="ZeroFormatterAnalyzer.json" />
+ </ItemGroup>
+ <ItemGroup>
+ <Analyzer Include="..\..\packages\ZeroFormatter.Analyzer.1.0.7\analyzers\dotnet\cs\ZeroFormatterAnalyzer.dll" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -1,6 +1,8 @@
using System;
using ZeroFormatter;
+#pragma warning disable ZeroFormatterAnalyzer_PublicPropertyNeedsIndex // Lint of ZeroFormattable Type.
+#pragma warning disable ZeroFormatterAnalyzer_PublicPropertyMustBeVirtual // Lint of ZeroFormattable Type.
namespace Sandbox.Shared
{
@@ -16,10 +18,10 @@ public abstract class Character
public abstract CharacterType Type { get; }
}
+
[ZeroFormattable]
public class Human : Character
{
- [IgnoreFormat]
public override CharacterType Type
{
get
@@ -41,7 +43,6 @@ public override CharacterType Type
[ZeroFormattable]
public class Monster : Character
{
- [IgnoreFormat]
public override CharacterType Type
{
get
@@ -60,3 +61,7 @@ public override CharacterType Type
public virtual int Magic { get; set; }
}
}
+
+
+#pragma warning restore ZeroFormatterAnalyzer_PublicPropertyNeedsIndex // Lint of ZeroFormattable Type.
+#pragma warning restore ZeroFormatterAnalyzer_PublicPropertyMustBeVirtual // Lint of ZeroFormattable Type.
@@ -0,0 +1 @@
+[ "System.Guid" ]
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="ZeroFormatter.Analyzer" version="1.0.7" targetFramework="net45" />
+</packages>
@@ -70,6 +70,27 @@ public class MyGuid
public virtual KeyValuePair<string, int> MyProperty3 { get; set; }
}
+ [ZeroFormattable]
+ public class Version1
+ {
+ [Index(0)]
+ public virtual int Prop1 { get; set; }
+ [Index(1)]
+ public virtual int Prop2 { get; set; }
+ }
+
+ [ZeroFormattable]
+ public class Version2
+ {
+ [Index(0)]
+ public virtual int Prop1 { get; set; }
+ [Index(1)]
+ public virtual int Prop2 { get; set; }
+ // You can add new property. If deserialize from old data, value is assigned default(T).
+ [Index(2)]
+ public virtual int NewType { get; set; }
+ }
+
class Program
{
@@ -82,6 +103,7 @@ static void Main(string[] args)
//var data = ZeroFormatterSerializer.Serialize<Character>(demon);
ZeroFormatterSerializer.Serialize<Character>(demon);
+
}
}
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.1.0")]
-[assembly: AssemblyFileVersion("1.2.1.0")]
+[assembly: AssemblyVersion("1.3.0.0")]
+[assembly: AssemblyFileVersion("1.3.0.0")]
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
- <Identity Id="ZeroFormatterAnalyzer.343bae8e-c880-437c-9e30-748b9e0f9b6e" Version="1.2.1" Language="en-US" Publisher="neuecc"/>
+ <Identity Id="ZeroFormatterAnalyzer.343bae8e-c880-437c-9e30-748b9e0f9b6e" Version="1.3.0" Language="en-US" Publisher="neuecc"/>
<DisplayName>ZeroFormatterAnalyzer</DisplayName>
<Description xml:space="preserve">New Launcher of ZeroFormatter.Analyzer</Description>
</Metadata>
Oops, something went wrong.

0 comments on commit 853a0d0

Please sign in to comment.