Skip to content

Commit 3f956a2

Browse files
committed
Update style and docs
1 parent 9f4545f commit 3f956a2

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Example/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
class SomeClass
77
{
8-
public string SomeString { get; set; }
8+
public string? SomeString { get; set; }
99

1010
public int SomeInt { get; set; }
1111

12-
public int[] SomeInts { get; set; }
12+
public int[]? SomeInts { get; set; }
1313

1414
public DateTime SomeDate { get; set; }
1515

@@ -68,9 +68,9 @@ private static void HowToCreateAConfig()
6868
// as long as the string value of the setting can be converted to the type you wish to obtain.
6969
string nameValue = cfg["SomeStructure"]["SomeString"].StringValue;
7070

71-
int ageValue = cfg["SomeStructure"]["SomeInt"].IntValue;
71+
var ageValue = cfg["SomeStructure"]["SomeInt"].IntValue;
7272

73-
DateTime dateValue = cfg["SomeStructure"]["SomeDate"].DateTimeValue;
73+
var dateValue = cfg["SomeStructure"]["SomeDate"].DateTimeValue;
7474

7575
// Print our config just to see that it works.
7676
PrintConfig(cfg);
@@ -113,7 +113,7 @@ private static void HowToCreateObjectsFromSections()
113113
// Test.
114114
Console.WriteLine("SomeString: " + p.SomeString);
115115
Console.WriteLine("SomeInt: " + p.SomeInt);
116-
PrintArray("SomeInts", p.SomeInts);
116+
PrintArray("SomeInts", p.SomeInts!);
117117
Console.WriteLine("SomeDate: " + p.SomeDate);
118118
}
119119

Src/Configuration.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public static CultureInfo CultureInfo
586586

587587
/// <summary>
588588
/// Gets the array that contains all valid comment delimiting characters.
589-
/// The current value is { '#', ';' }.
589+
/// The default value is { '#', ';' }.
590590
/// </summary>
591591
public static HashSet<char> ValidCommentChars { get; private set; }
592592

@@ -599,7 +599,8 @@ public static CultureInfo CultureInfo
599599
public static char PreferredCommentChar
600600
{
601601
get => s_preferredCommentChar;
602-
set {
602+
set
603+
{
603604
if (!ValidCommentChars.Contains(value))
604605
{
605606
throw new ArgumentException("The specified char '" + value + "' is not allowed as a comment char.");
@@ -620,7 +621,8 @@ public static char PreferredCommentChar
620621
public static char ArrayElementSeparator
621622
{
622623
get => s_arrayElementSeparator;
623-
set {
624+
set
625+
{
624626
if (value == '\0')
625627
{
626628
throw new ArgumentException("Zero-character is not allowed.");

0 commit comments

Comments
 (0)