Skip to content

Commit

Permalink
refactor: move old exception messages from Resources.resx (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbooth committed Apr 3, 2023
1 parent d27f4ca commit 3c85ae6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 217 deletions.
81 changes: 0 additions & 81 deletions X10D/Resource.Designer.cs

This file was deleted.

126 changes: 0 additions & 126 deletions X10D/Resource.resx

This file was deleted.

9 changes: 0 additions & 9 deletions X10D/X10D.csproj
Expand Up @@ -68,11 +68,6 @@
</ItemGroup>

<ItemGroup>
<Compile Update="Resource.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resource.resx</DependentUpon>
</Compile>
<Compile Update="src\ExceptionMessages.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
Expand All @@ -81,10 +76,6 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="src\ExceptionMessages.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ExceptionMessages.Designer.cs</LastGenOutput>
Expand Down
18 changes: 18 additions & 0 deletions X10D/src/ExceptionMessages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions X10D/src/ExceptionMessages.resx
Expand Up @@ -132,6 +132,12 @@
<data name="EndIndexGreaterThanCount" xml:space="preserve">
<value>The end index must be less than the list count.</value>
</data>
<data name="EnumParseEmptyStringException" xml:space="preserve">
<value>Must specify valid information for parsing in the string.</value>
</data>
<data name="EnumParseNotEnumException" xml:space="preserve">
<value>Type provided must be an Enum.</value>
</data>
<data name="TypeIsNotClass" xml:space="preserve">
<value>{0} is not a class.</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion X10D/src/Text/StringExtensions.cs
Expand Up @@ -414,7 +414,7 @@ public static T EnumParse<T>(this string value, bool ignoreCase)

if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentException(Resource.EnumParseEmptyStringException, nameof(value));
throw new ArgumentException(ExceptionMessages.EnumParseEmptyStringException, nameof(value));
}

return Enum.Parse<T>(value, ignoreCase);
Expand Down

0 comments on commit 3c85ae6

Please sign in to comment.