diff --git a/XmlSchemaClassGenerator.Console/Program.cs b/XmlSchemaClassGenerator.Console/Program.cs index f11de078..bdabdb7b 100644 --- a/XmlSchemaClassGenerator.Console/Program.cs +++ b/XmlSchemaClassGenerator.Console/Program.cs @@ -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 { @@ -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 }, }; @@ -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); } diff --git a/XmlSchemaClassGenerator/Generator.cs b/XmlSchemaClassGenerator/Generator.cs index 32e60172..79f71d07 100644 --- a/XmlSchemaClassGenerator/Generator.cs +++ b/XmlSchemaClassGenerator/Generator.cs @@ -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; } diff --git a/XmlSchemaClassGenerator/GeneratorConfiguration.cs b/XmlSchemaClassGenerator/GeneratorConfiguration.cs index 68c69731..97793809 100644 --- a/XmlSchemaClassGenerator/GeneratorConfiguration.cs +++ b/XmlSchemaClassGenerator/GeneratorConfiguration.cs @@ -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; } } diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index fe5fef64..72b3ef19 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -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) {