Skip to content

Commit 64fbf6a

Browse files
committed
Code cleanup
* Switch JSON methods to be Pascal case * Switch to consistent use of "String" vs. "string" * Switch to consistent use of "Boolean" vs. "bool"
1 parent 497f83d commit 64fbf6a

29 files changed

Lines changed: 90 additions & 87 deletions

TinCan/About.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public About(JObject jobj)
4444
}
4545
}
4646

47-
public override JObject toJObject(TCAPIVersion version) {
47+
public override JObject ToJObject(TCAPIVersion version) {
4848
JObject result = new JObject();
4949
if (version != null)
5050
{
@@ -57,7 +57,7 @@ public override JObject toJObject(TCAPIVersion version) {
5757

5858
if (extensions != null && ! extensions.isEmpty())
5959
{
60-
result.Add("extensions", extensions.toJObject(version));
60+
result.Add("extensions", extensions.ToJObject(version));
6161
}
6262

6363
return result;

TinCan/Activity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public Activity(JObject jobj)
4343
}
4444
}
4545

46-
public override JObject toJObject(TCAPIVersion version)
46+
public override JObject ToJObject(TCAPIVersion version)
4747
{
4848
JObject result = new JObject();
4949
result.Add("objectType", ObjectType);
@@ -54,7 +54,7 @@ public override JObject toJObject(TCAPIVersion version)
5454
}
5555
if (definition != null)
5656
{
57-
result.Add("definition", definition.toJObject(version));
57+
result.Add("definition", definition.ToJObject(version));
5858
}
5959

6060
return result;

TinCan/ActivityDefinition.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public ActivityDefinition(JObject jobj)
6262
}
6363
}
6464

65-
public override JObject toJObject(TCAPIVersion version) {
65+
public override JObject ToJObject(TCAPIVersion version) {
6666
JObject result = new JObject();
6767

6868
if (type != null)
@@ -75,15 +75,15 @@ public override JObject toJObject(TCAPIVersion version) {
7575
}
7676
if (name != null && ! name.isEmpty())
7777
{
78-
result.Add("name", name.toJObject(version));
78+
result.Add("name", name.ToJObject(version));
7979
}
8080
if (description != null && ! description.isEmpty())
8181
{
82-
result.Add("description", description.toJObject(version));
82+
result.Add("description", description.ToJObject(version));
8383
}
8484
if (extensions != null && ! extensions.isEmpty())
8585
{
86-
result.Add("extensions", extensions.toJObject(version));
86+
result.Add("extensions", extensions.ToJObject(version));
8787
}
8888

8989
return result;

TinCan/Agent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public Agent(JObject jobj)
5959
}
6060
}
6161

62-
public override JObject toJObject(TCAPIVersion version)
62+
public override JObject ToJObject(TCAPIVersion version)
6363
{
6464
JObject result = new JObject();
6565
result.Add("objectType", ObjectType);
@@ -71,7 +71,7 @@ public override JObject toJObject(TCAPIVersion version)
7171

7272
if (account != null)
7373
{
74-
result.Add("account", account.toJObject(version));
74+
result.Add("account", account.ToJObject(version));
7575
}
7676
else if (mbox != null)
7777
{

TinCan/AgentAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public AgentAccount(Uri homePage, String name)
4747
this.name = name;
4848
}
4949

50-
public override JObject toJObject(TCAPIVersion version)
50+
public override JObject ToJObject(TCAPIVersion version)
5151
{
5252
JObject result = new JObject();
5353
if (homePage != null)

TinCan/Context.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Context(JObject jobj)
7777
}
7878
}
7979

80-
public override JObject toJObject(TCAPIVersion version) {
80+
public override JObject ToJObject(TCAPIVersion version) {
8181
JObject result = new JObject();
8282

8383
if (registration != null)
@@ -86,15 +86,15 @@ public override JObject toJObject(TCAPIVersion version) {
8686
}
8787
if (instructor != null)
8888
{
89-
result.Add("instructor", instructor.toJObject(version));
89+
result.Add("instructor", instructor.ToJObject(version));
9090
}
9191
if (team != null)
9292
{
93-
result.Add("team", team.toJObject(version));
93+
result.Add("team", team.ToJObject(version));
9494
}
9595
if (contextActivities != null)
9696
{
97-
result.Add("contextActivities", contextActivities.toJObject(version));
97+
result.Add("contextActivities", contextActivities.ToJObject(version));
9898
}
9999
if (revision != null)
100100
{
@@ -110,11 +110,11 @@ public override JObject toJObject(TCAPIVersion version) {
110110
}
111111
if (statement != null)
112112
{
113-
result.Add("statement", statement.toJObject(version));
113+
result.Add("statement", statement.ToJObject(version));
114114
}
115115
if (extensions != null)
116116
{
117-
result.Add("extensions", extensions.toJObject(version));
117+
result.Add("extensions", extensions.ToJObject(version));
118118
}
119119

120120
return result;

TinCan/ContextActivities.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public ContextActivities(JObject jobj)
6262
}
6363
}
6464

65-
public override JObject toJObject(TCAPIVersion version) {
65+
public override JObject ToJObject(TCAPIVersion version) {
6666
JObject result = new JObject();
6767

6868
if (parent != null && parent.Count > 0)
@@ -72,7 +72,7 @@ public override JObject toJObject(TCAPIVersion version) {
7272

7373
foreach (Activity activity in parent)
7474
{
75-
jparent.Add(activity.toJObject(version));
75+
jparent.Add(activity.ToJObject(version));
7676
}
7777
}
7878
if (grouping != null && grouping.Count > 0)
@@ -82,7 +82,7 @@ public override JObject toJObject(TCAPIVersion version) {
8282

8383
foreach (Activity activity in grouping)
8484
{
85-
jgrouping.Add(activity.toJObject(version));
85+
jgrouping.Add(activity.ToJObject(version));
8686
}
8787
}
8888
if (category != null && category.Count > 0)
@@ -92,7 +92,7 @@ public override JObject toJObject(TCAPIVersion version) {
9292

9393
foreach (Activity activity in category)
9494
{
95-
jcategory.Add(activity.toJObject(version));
95+
jcategory.Add(activity.ToJObject(version));
9696
}
9797
}
9898
if (other != null && other.Count > 0)
@@ -102,7 +102,7 @@ public override JObject toJObject(TCAPIVersion version) {
102102

103103
foreach (Activity activity in other)
104104
{
105-
jother.Add(activity.toJObject(version));
105+
jother.Add(activity.ToJObject(version));
106106
}
107107
}
108108

TinCan/Extensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public Extensions(JObject jobj) : this()
3737
}
3838
}
3939

40-
public override JObject toJObject(TCAPIVersion version)
40+
public override JObject ToJObject(TCAPIVersion version)
4141
{
4242
JObject result = new JObject();
4343
foreach (KeyValuePair<Uri, JToken> entry in map)
@@ -48,7 +48,7 @@ public override JObject toJObject(TCAPIVersion version)
4848
return result;
4949
}
5050

51-
public bool isEmpty()
51+
public Boolean isEmpty()
5252
{
5353
return map.Count > 0 ? false : true;
5454
}

TinCan/Group.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ public Group(JObject jobj) : base(jobj)
4242
}
4343
}
4444

45-
public override JObject toJObject(TCAPIVersion version)
45+
public override JObject ToJObject(TCAPIVersion version)
4646
{
47-
JObject result = base.toJObject(version);
47+
JObject result = base.ToJObject(version);
4848
if (member != null && member.Count > 0)
4949
{
5050
var jmember = new JArray();
5151
result.Add("member", jmember);
5252

5353
foreach (Agent agent in member)
5454
{
55-
jmember.Add(agent.toJObject(version));
55+
jmember.Add(agent.ToJObject(version));
5656
}
5757
}
5858

TinCan/LRSResponse/Base.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace TinCan.LRSResponse
2323
//
2424
public class Base
2525
{
26-
public bool success { get; set; }
26+
public Boolean success { get; set; }
2727
public Exception httpException { get; set; }
2828
public String errMsg { get; set; }
2929

0 commit comments

Comments
 (0)