Skip to content

Commit

Permalink
Rename configuration AllowSectionsOnFly -> AllowCreateSectionsOnFly
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyah committed Feb 17, 2017
1 parent 0d79c77 commit 6b94b2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void escape_section_regex_special_characters()
public void alway_returns_a_valid_section()
{
var parser = new IniDataParser();
parser.Configuration.AllowSectionsOnFly = true;
parser.Configuration.AllowCreateSectionsOnFly = true;

var iniData = parser.Parse("");
Assert.IsNotNull(iniData["noname"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public IniParserConfiguration()
AllowKeysWithoutSection = true;
AllowDuplicateKeys = false;
AllowDuplicateSections = false;
AllowSectionsOnFly = true;
AllowCreateSectionsOnFly = true;
ThrowExceptionsOnError = true;
SkipInvalidLines = false;
}
Expand All @@ -73,7 +73,7 @@ public IniParserConfiguration(IniParserConfiguration ori)
OverrideDuplicateKeys = ori.OverrideDuplicateKeys;
AllowDuplicateSections = ori.AllowDuplicateSections;
AllowKeysWithoutSection = ori.AllowKeysWithoutSection;
AllowSectionsOnFly = ori.AllowSectionsOnFly;
AllowCreateSectionsOnFly = ori.AllowCreateSectionsOnFly;

SectionStartChar = ori.SectionStartChar;
SectionEndChar = ori.SectionEndChar;
Expand Down Expand Up @@ -273,7 +273,7 @@ public string NewLineStr
/// <remarks>
/// Defaults to <c>false</c>.
/// </remarks>
public bool AllowSectionsOnFly { get; set; }
public bool AllowCreateSectionsOnFly { get; set; }

public bool SkipInvalidLines { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion src/IniFileParser/Model/IniData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public KeyDataCollection this[string sectionName]
get
{
if (!_sections.ContainsSection(sectionName))
if (Configuration.AllowSectionsOnFly)
if (Configuration.AllowCreateSectionsOnFly)
_sections.AddSection(sectionName);
else
return null;
Expand Down

0 comments on commit 6b94b2d

Please sign in to comment.