Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions JsonTest/System.Text.Json/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("2.0.0.11")]
[assembly: AssemblyFileVersion("2.0.0.11")]
[assembly: AssemblyVersion("2.0.1.11")]
[assembly: AssemblyFileVersion("2.0.1.11")]
2 changes: 1 addition & 1 deletion JsonTest/System.Text.Json/JsonParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ private decimal ParseDecimal(int outer)
private Guid ParseGuid(int outer)
{
var s = ParseString(0);
if (!String.IsNullOrWhiteSpace(s))
if (!StringExtensions.IsNullOrWhiteSpace(s))
return new Guid(s);
throw Error("Bad GUID");
}
Expand Down
8 changes: 8 additions & 0 deletions JsonTest/System.Text.Json/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace System {
public static class StringExtensions {
public static bool IsNullOrWhiteSpace(this string value) {
if (value == null) return true;
return string.IsNullOrEmpty(value.Trim());
}
}
}
5 changes: 4 additions & 1 deletion JsonTest/System.Text.Json/System.Text.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>System.Text.Json</RootNamespace>
<AssemblyName>System.Text.Json</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -44,6 +45,8 @@
<Compile Include="JsonParser.cs" />
<Compile Include="LambdaCompilation.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="StringExtensions.cs" />
<Compile Include="Tuple.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
155 changes: 155 additions & 0 deletions JsonTest/System.Text.Json/Tuple.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
namespace System {
public class Tuple {
public static Tuple<T1> Create<T1>(T1 t1) {
return new Tuple<T1>(t1);
}

public static Tuple<T1, T2> Create<T1, T2>(T1 t1, T2 t2) {
return new Tuple<T1, T2>(t1, t2);
}

public static Tuple<T1, T2, T3> Create<T1, T2, T3>(T1 t1, T2 t2, T3 t3) {
return new Tuple<T1, T2, T3>(t1, t2, t3);
}

static Tuple<T1, T2, T3, T4> Create<T1, T2, T3, T4>(T1 t1, T2 t2, T3 t3, T4 t4) {
return new Tuple<T1, T2, T3, T4>(t1, t2, t3, t4);
}

static Tuple<T1, T2, T3, T4, T5> Create<T1, T2, T3, T4, T5>(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) {
return new Tuple<T1, T2, T3, T4, T5>(t1, t2, t3, t4, t5);
}

static Tuple<T1, T2, T3, T4, T5, T6> Create<T1, T2, T3, T4, T5, T6>(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6) {
return new Tuple<T1, T2, T3, T4, T5, T6>(t1, t2, t3, t4, t5, t6);
}

static Tuple<T1, T2, T3, T4, T5, T6, T7> Create<T1, T2, T3, T4, T5, T6, T7>(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) {
return new Tuple<T1, T2, T3, T4, T5, T6, T7>(t1, t2, t3, t4, t5, t6, t7);
}

static Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> Create<T1, T2, T3, T4, T5, T6, T7, TRest>(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, TRest Rest) {
return new Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>(t1, t2, t3, t4, t5, t6, t7, Rest);
}
}

public class Tuple<T1> : Tuple {
public T1 Item1 { get; set; }

public Tuple(T1 Item1) {
this.Item1 = Item1;
}
}

public class Tuple<T1, T2> {
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }

public Tuple(T1 Item1, T2 Item2) {
this.Item1 = Item1;
this.Item2 = Item2;
}
}

public class Tuple<T1, T2, T3> {
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public T3 Item3 { get; set; }

public Tuple(T1 Item1, T2 Item2, T3 Item3) {
this.Item1 = Item1;
this.Item2 = Item2;
this.Item3 = Item3;
}
}

public class Tuple<T1, T2, T3, T4> {
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public T3 Item3 { get; set; }
public T4 Item4 { get; set; }

public Tuple(T1 Item1, T2 Item2, T3 Item3, T4 Item4) {
this.Item1 = Item1;
this.Item2 = Item2;
this.Item3 = Item3;
this.Item4 = Item4;
}
}

public class Tuple<T1, T2, T3, T4, T5> {
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public T3 Item3 { get; set; }
public T4 Item4 { get; set; }
public T5 Item5 { get; set; }

public Tuple(T1 Item1, T2 Item2, T3 Item3, T4 Item4, T5 Item5) {
this.Item1 = Item1;
this.Item2 = Item2;
this.Item3 = Item3;
this.Item4 = Item4;
this.Item5 = Item5;
}
}

public class Tuple<T1, T2, T3, T4, T5, T6> {
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public T3 Item3 { get; set; }
public T4 Item4 { get; set; }
public T5 Item5 { get; set; }
public T6 Item6 { get; set; }

public Tuple(T1 Item1, T2 Item2, T3 Item3, T4 Item4, T5 Item5, T6 Item6) {
this.Item1 = Item1;
this.Item2 = Item2;
this.Item3 = Item3;
this.Item4 = Item4;
this.Item5 = Item5;
this.Item6 = Item6;
}
}

public class Tuple<T1, T2, T3, T4, T5, T6, T7> {
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public T3 Item3 { get; set; }
public T4 Item4 { get; set; }
public T5 Item5 { get; set; }
public T6 Item6 { get; set; }
public T7 Item7 { get; set; }

public Tuple(T1 Item1, T2 Item2, T3 Item3, T4 Item4, T5 Item5, T6 Item6, T7 Item7) {
this.Item1 = Item1;
this.Item2 = Item2;
this.Item3 = Item3;
this.Item4 = Item4;
this.Item5 = Item5;
this.Item6 = Item6;
this.Item7 = Item7;
}
}

public class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> {
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public T3 Item3 { get; set; }
public T4 Item4 { get; set; }
public T5 Item5 { get; set; }
public T6 Item6 { get; set; }
public T7 Item7 { get; set; }
public TRest Rest { get; set; }

public Tuple(T1 Item1, T2 Item2, T3 Item3, T4 Item4, T5 Item5, T6 Item6, T7 Item7, TRest Rest) {
this.Item1 = Item1;
this.Item2 = Item2;
this.Item3 = Item3;
this.Item4 = Item4;
this.Item5 = Item5;
this.Item6 = Item6;
this.Item7 = Item7;
this.Rest = Rest;
}
}
}