Skip to content

Commit ed603af

Browse files
committed
Style fixes
1 parent cf9c789 commit ed603af

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

RedditSharp/RedditSharp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
<Compile Include="Things\WikiPageRevision.cs" />
9797
<Compile Include="WikiPageSettings.cs" />
9898
<Compile Include="Domain.cs" />
99-
<Compile Include="tbUserNote.cs" />
100-
<Compile Include="ToolBoxUserNotes.cs" />
99+
<Compile Include="TBUserNote.cs" />
100+
<Compile Include="ToolBoxUserNotes.cs" />
101101
<Compile Include="ToolBoxUserNotesException.cs" />
102102
</ItemGroup>
103103
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

RedditSharp/Things/Subreddit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public IEnumerable<ModeratorUser> Moderators
264264
}
265265
}
266266

267-
public IEnumerable<tbUserNote> UserNotes
267+
public IEnumerable<TBUserNote> UserNotes
268268
{
269269
get
270270
{

RedditSharp/ToolBoxUserNotes.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace RedditSharp
1111
public static class ToolBoxUserNotes
1212
{
1313
private const string ToolBoxUserNotesWiki = "/r/{0}/wiki/usernotes";
14-
public static IEnumerable<tbUserNote> GetUserNotes( IWebAgent webAgent, string subName)
14+
public static IEnumerable<TBUserNote> GetUserNotes(IWebAgent webAgent, string subName)
1515
{
1616
var request = webAgent.CreateGet(String.Format(ToolBoxUserNotesWiki, subName));
1717
var reqResponse = webAgent.ExecuteRequest(request);
@@ -22,11 +22,10 @@ public static IEnumerable<tbUserNote> GetUserNotes( IWebAgent webAgent, string s
2222

2323
string[] warnings = response["constants"]["warnings"].Values<string>().ToArray();
2424

25-
if (version < 6)
25+
if (version < 6) throw new ToolBoxUserNotesException("Unsupported ToolBox version");
26+
27+
try
2628
{
27-
throw new ToolBoxUserNotesException("Unsupported ToolBox version");
28-
}
29-
try {
3029
var data = Convert.FromBase64String(response["blob"].Value<string>());
3130

3231
string uncompressed;
@@ -46,14 +45,14 @@ public static IEnumerable<tbUserNote> GetUserNotes( IWebAgent webAgent, string s
4645

4746
JObject users = JObject.Parse(uncompressed);
4847

49-
List<tbUserNote> toReturn = new List<tbUserNote>();
48+
List<TBUserNote> toReturn = new List<TBUserNote>();
5049
foreach (KeyValuePair<string, JToken> user in users)
5150
{
5251
var x = user.Value;
5352
foreach (JToken note in x["ns"].Children())
5453
{
5554

56-
tbUserNote uNote = new tbUserNote();
55+
TBUserNote uNote = new TBUserNote();
5756
uNote.AppliesToUsername = user.Key;
5857
uNote.SubName = subName;
5958
uNote.SubmitterIndex = note["m"].Value<int>();
@@ -69,17 +68,16 @@ public static IEnumerable<tbUserNote> GetUserNotes( IWebAgent webAgent, string s
6968
}
7069
return toReturn;
7170
}
72-
catch(Exception e)
71+
catch (Exception e)
7372
{
7473
throw new ToolBoxUserNotesException("An error occured while processing Usernotes wiki. See inner exception for details", e);
7574
}
76-
7775
}
78-
public static string UnsquashLink(string subreddit,string permalink)
76+
public static string UnsquashLink(string subreddit, string permalink)
7977
{
80-
8178
var link = "https://reddit.com/r/" + subreddit + "/";
82-
if (string.IsNullOrEmpty(permalink)) {
79+
if (string.IsNullOrEmpty(permalink))
80+
{
8381
return link;
8482
}
8583
var linkParams = permalink.Split(',');
@@ -94,7 +92,6 @@ public static string UnsquashLink(string subreddit,string permalink)
9492
{
9593
link += "message/messages/" + linkParams[1];
9694
}
97-
9895
return link;
9996
}
10097
}

RedditSharp/tbUserNote.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace RedditSharp
88
{
9-
public class tbUserNote
9+
public class TBUserNote
1010
{
1111
public int NoteTypeIndex { get; set; }
1212
public string NoteType { get; set; }

0 commit comments

Comments
 (0)