Skip to content

Commit af3b2f3

Browse files
committed
Fix name validation for EncapsulateFieldDialog
1 parent 9d2c779 commit af3b2f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

RetailCoder.VBE/UI/Refactorings/EncapsulateFieldDialog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private void ValidatePropertyName()
171171
{
172172
InvalidPropertyNameIcon.Visible = ValidateName(NewPropertyName, ParameterName) ||
173173
_state.AllUserDeclarations.Where(a => a.ParentScope == TargetDeclaration.ParentScope)
174-
.Any(a => a.IdentifierName == NewPropertyName);
174+
.Any(a => a.IdentifierName.Equals(NewPropertyName, StringComparison.InvariantCultureIgnoreCase));
175175

176176
SetOkButtonEnabledState();
177177
}
@@ -188,8 +188,8 @@ private bool ValidateName(string changedName, string otherName)
188188
var tokenValues = typeof(Tokens).GetFields().Select(item => item.GetValue(null)).Cast<string>().Select(item => item);
189189

190190
return TargetDeclaration == null
191-
|| changedName == TargetDeclaration.IdentifierName
192-
|| changedName == otherName
191+
|| changedName.Equals(TargetDeclaration.IdentifierName, StringComparison.InvariantCultureIgnoreCase)
192+
|| changedName.Equals(otherName, StringComparison.InvariantCultureIgnoreCase)
193193
|| !char.IsLetter(changedName.FirstOrDefault())
194194
|| tokenValues.Contains(ParameterName, StringComparer.InvariantCultureIgnoreCase)
195195
|| changedName.Any(c => !char.IsLetterOrDigit(c) && c != '_');

0 commit comments

Comments
 (0)