Skip to content

Commit

Permalink
remove one option: GenerateSetterInCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkoKacprzak committed Apr 8, 2018
1 parent 13e92ed commit 773c911
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
3 changes: 0 additions & 3 deletions XmlSchemaClassGenerator.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static void Main(string[] args)
string textValuePropertyName = "Value";
var generateDebuggerStepThroughAttribute = true;
var disableComments = false;
var setterInCollection = false;
var doNotUseUnderscoreInPrivateMemberNames = false;

var options = new OptionSet {
Expand Down Expand Up @@ -79,7 +78,6 @@ A file name may be given by appending a pipe sign (|) followed by a file name (l
{ "tvpn|textValuePropertyName=", "the name of the property that holds the text value of an element (default is Value)", v => textValuePropertyName = v },
{ "dst|debuggerStepThrough", "generate DebuggerStepThroughAttribute (default is enabled)", v => generateDebuggerStepThroughAttribute = v != null },
{ "dc|disableComments", "do not include comments from xsd", v => disableComments = v != null },
{ "sc|setterInCollection", "generate setter in Collection (default is false)", v => setterInCollection = v != null },
{ "nu|noUnderscore", "do not generate underscore in private member name (default is false)", v => doNotUseUnderscoreInPrivateMemberNames = v != null },
};

Expand Down Expand Up @@ -134,7 +132,6 @@ A file name may be given by appending a pipe sign (|) followed by a file name (l
generator.GenerateDebuggerStepThroughAttribute = false;
generator.DataAnnotationMode = DataAnnotationMode.None;
}
generator.GenerateSetterInCollection = setterInCollection;
generator.DoNotUseUnderscoreInPrivateMemberNames = doNotUseUnderscoreInPrivateMemberNames;
if (verbose) { generator.Log = s => System.Console.Out.WriteLine(s); }

Expand Down
7 changes: 1 addition & 6 deletions XmlSchemaClassGenerator/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,7 @@ public bool DisableComments
get { return _configuration.DisableComments; }
set { _configuration.DisableComments = value; }
}

public bool GenerateSetterInCollection
{
get { return _configuration.GenerateSetterInCollection; }
set { _configuration.GenerateSetterInCollection = value; }
}

public bool DoNotUseUnderscoreInPrivateMemberNames
{
get { return _configuration.DoNotUseUnderscoreInPrivateMemberNames; }
Expand Down
1 change: 0 additions & 1 deletion XmlSchemaClassGenerator/GeneratorConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ public void WriteLog(string message)
public NamingProvider NamingProvider { get; set; }

public bool DisableComments { get; set; }
public bool GenerateSetterInCollection { get; set; }
public bool DoNotUseUnderscoreInPrivateMemberNames { get; set; }

}
Expand Down
2 changes: 1 addition & 1 deletion XmlSchemaClassGenerator/TypeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ public void AddMembersTo(CodeTypeDeclaration typeDeclaration, bool withDataBindi
else
member = new CodeMemberField(typeReference, propertyName);

var isPrivateSetter = !Configuration.GenerateSetterInCollection && (IsCollection || isArray);
var isPrivateSetter = IsCollection || isArray;

if (requiresBackingField)
{
Expand Down

0 comments on commit 773c911

Please sign in to comment.