Skip to content

Fix Invalid_IInputElement resource#6691

Merged
singhashish-wpf merged 4 commits intodotnet:mainfrom
ThomasGoulet73:fix-resources
Jul 14, 2022
Merged

Fix Invalid_IInputElement resource#6691
singhashish-wpf merged 4 commits intodotnet:mainfrom
ThomasGoulet73:fix-resources

Conversation

@ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented Jun 16, 2022

Description

Fixes a small bug in the Invalid_IInputElement resource. UIElement3D is not included in the message even if it is supported.
Fixes a small bug in some usage of the Invalid_IInputElement resource. Some usage were not passing an argument in the Get method so the format would return the message unformated.

Also added a couple of comment cleanup that did not include UIElement3D in the supported list.

Customer Impact

Give proper exception message.

Regression

No. This is probably an old "bug" when UIElement3D was introduced.

Testing

Local build + CI.

Risk

Low. Exception message could change but I don't think it is breaking

Microsoft Reviewers: Open in CodeFlow

@ThomasGoulet73 ThomasGoulet73 requested a review from a team as a code owner June 16, 2022 04:48
@ghost ghost assigned ThomasGoulet73 Jun 16, 2022
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Jun 16, 2022
@ghost ghost requested review from SamBent, dipeshmsft and singhashish-wpf June 16, 2022 04:48
@ghost ghost added the Community Contribution A label for all community Contributions label Jun 16, 2022
if (!InputElement.IsValid(element))
{
throw new ArgumentException(SR.Get(SRID.Invalid_IInputElement), "element");
throw new ArgumentException(SR.Get(SRID.Invalid_IInputElement, element.GetType()), nameof(element));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example of a call to SR.Get using Invalid_IInputElement and not passing a parameter for the format.

Here's the content of Invalid_IInputElement:

<value>'{0}' is not a valid type for IInputElement. UIElement, ContentElement or UIElement3D expected.</value>

@dipeshmsft dipeshmsft self-assigned this Jun 20, 2022
@dipeshmsft
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dipeshmsft
Copy link
Member

This PR will be taken in the next community test pass.

@singhashish-wpf singhashish-wpf merged commit 028bc1e into dotnet:main Jul 14, 2022
@ThomasGoulet73 ThomasGoulet73 deleted the fix-resources branch July 14, 2022 13:00
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants