96
private Stack<IUndoableCommand> stack = new Stack<IUndoableCommand>();
1
using System;
2
using System.Collections;
3
using System.Collections.Generic;
4
5
public interface ICommand
6
{
7
void Execute();
8
}
9
10
public interface IUndoableCommand: ICommand
11
{
12
void Unexecute();
13
}
14
15
public class Document
16
{
17
public string Content {get; set;}
18
public void MakeBold()
19
{
20
Content = "<b>" + Content + "</b>";
21
}
22
}
23
24
public class BoldCommand: IUndoableCommand
Cached Result
Environment version: 4.0.30319.42000
Json.NET version: Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
Testing conversion of Question49898782.KeyList to System.Data.DataTable.
Input JSON:
{ "ssid" : 1,
"dim" : 2,
"type" : 3,
"list_of_business_keys":
[
{"business_key" : {"column_1" : 100, "column_2" : 1000}},
{"business_key" : {"column_1" : 200, "column_2" : 1000}},
{"business_key" : {"column_1" : 300, "column_2" : 1000}},
{"business_key" : {"column_1" : 400, "column_2" : 1000}},
{"business_key" : {"column_1" : 500, "column_2" : 1000}}
]
}
Output System.Data.DataTable:
[
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 100,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 200,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 300,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 400,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 500,
"column_2": 1000
}
]
Testing conversion of Question49898782.KeyList to System.Data.DataTable.
Input JSON:
{ "ssid" : 1,
"dim" : 2,
"type" : 3,
"list_of_business_keys":
[
{"business_key" : {"xxx" : "abc", "yyy" : 1000, "zzz" : 123}},
{"business_key" : {"xxx" : "cde", "yyy" : 1000, "zzz" : 456}},
{"business_key" : {"xxx" : "efg", "yyy" : 1000, "zzz" : 789}},
{"business_key" : {"xxx" : "hij", "yyy" : 1000, "zzz" : 12 }},
{"business_key" : {"xxx" : "klm", "yyy" : 1000, "zzz" : 345}}
]
}
Output System.Data.DataTable:
[
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "abc",
"yyy": 1000,
"zzz": 123
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "cde",
"yyy": 1000,
"zzz": 456
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "efg",
"yyy": 1000,
"zzz": 789
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "hij",
"yyy": 1000,
"zzz": 12
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "klm",
"yyy": 1000,
"zzz": 345
}
]
Testing conversion of Question49898782.KeyList to System.Data.DataTable.
Input JSON:
{ "ssid" : 1,
"dim" : 2,
"type" : 3,
"list_of_business_keys":
[
{"business_key" : {"xxx" : null, "yyy" : 1000, "zzz" : 123}},
{"business_key" : {"xxx" : "row contains string-value cell that was initially null", "yyy" : 1000, "zzz" : 456}},
{"business_key" : {"xxx" : "efg", "yyy" : 1000, "zzz" : 789}},
{"business_key" : {"xxx" : "row contains floating point cell that was initially integral", "yyy" : 1000, "zzz" : 12.123 }},
{"business_key" : {"added_property" : "added_value", "xxx" : "row contains string-valued cell that was initially integral", "yyy" : "1000", "zzz" : 345 }}
]
}
Output System.Data.DataTable:
[
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": null,
"yyy": "1000",
"zzz": 123.0,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "row contains string-value cell that was initially null",
"yyy": "1000",
"zzz": 456.0,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "efg",
"yyy": "1000",
"zzz": 789.0,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "row contains floating point cell that was initially integral",
"yyy": "1000",
"zzz": 12.123,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "row contains string-valued cell that was initially integral",
"yyy": "1000",
"zzz": 345.0,
"added_property": "added_value"
}
]
Done.
Json.NET version: Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
Testing conversion of Question49898782.KeyList to System.Data.DataTable.
Input JSON:
{ "ssid" : 1,
"dim" : 2,
"type" : 3,
"list_of_business_keys":
[
{"business_key" : {"column_1" : 100, "column_2" : 1000}},
{"business_key" : {"column_1" : 200, "column_2" : 1000}},
{"business_key" : {"column_1" : 300, "column_2" : 1000}},
{"business_key" : {"column_1" : 400, "column_2" : 1000}},
{"business_key" : {"column_1" : 500, "column_2" : 1000}}
]
}
Output System.Data.DataTable:
[
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 100,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 200,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 300,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 400,
"column_2": 1000
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"column_1": 500,
"column_2": 1000
}
]
Testing conversion of Question49898782.KeyList to System.Data.DataTable.
Input JSON:
{ "ssid" : 1,
"dim" : 2,
"type" : 3,
"list_of_business_keys":
[
{"business_key" : {"xxx" : "abc", "yyy" : 1000, "zzz" : 123}},
{"business_key" : {"xxx" : "cde", "yyy" : 1000, "zzz" : 456}},
{"business_key" : {"xxx" : "efg", "yyy" : 1000, "zzz" : 789}},
{"business_key" : {"xxx" : "hij", "yyy" : 1000, "zzz" : 12 }},
{"business_key" : {"xxx" : "klm", "yyy" : 1000, "zzz" : 345}}
]
}
Output System.Data.DataTable:
[
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "abc",
"yyy": 1000,
"zzz": 123
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "cde",
"yyy": 1000,
"zzz": 456
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "efg",
"yyy": 1000,
"zzz": 789
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "hij",
"yyy": 1000,
"zzz": 12
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "klm",
"yyy": 1000,
"zzz": 345
}
]
Testing conversion of Question49898782.KeyList to System.Data.DataTable.
Input JSON:
{ "ssid" : 1,
"dim" : 2,
"type" : 3,
"list_of_business_keys":
[
{"business_key" : {"xxx" : null, "yyy" : 1000, "zzz" : 123}},
{"business_key" : {"xxx" : "row contains string-value cell that was initially null", "yyy" : 1000, "zzz" : 456}},
{"business_key" : {"xxx" : "efg", "yyy" : 1000, "zzz" : 789}},
{"business_key" : {"xxx" : "row contains floating point cell that was initially integral", "yyy" : 1000, "zzz" : 12.123 }},
{"business_key" : {"added_property" : "added_value", "xxx" : "row contains string-valued cell that was initially integral", "yyy" : "1000", "zzz" : 345 }}
]
}
Output System.Data.DataTable:
[
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": null,
"yyy": "1000",
"zzz": 123.0,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "row contains string-value cell that was initially null",
"yyy": "1000",
"zzz": 456.0,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "efg",
"yyy": "1000",
"zzz": 789.0,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "row contains floating point cell that was initially integral",
"yyy": "1000",
"zzz": 12.123,
"added_property": null
},
{
"ssid": 1,
"dim": 2,
"type": 3,
"xxx": "row contains string-valued cell that was initially integral",
"yyy": "1000",
"zzz": 345.0,
"added_property": "added_value"
}
]
Done.