Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Create a thread safe OnPropertyChanged event method. #104

Merged
merged 4 commits into from
Mar 11, 2019
Merged

Create a thread safe OnPropertyChanged event method. #104

merged 4 commits into from
Mar 11, 2019

Conversation

RedX2501
Copy link
Contributor

@RedX2501 RedX2501 commented Mar 8, 2019

The current code is not thread safe.

This is a simple fix to generate the thread safe version.

I'm not sure where you keep a change log of the changes for each version.

@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #104 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   97.13%   97.13%   +<.01%     
==========================================
  Files          17       17              
  Lines        2964     2970       +6     
==========================================
+ Hits         2879     2885       +6     
  Misses         85       85
Impacted Files Coverage Δ
XmlSchemaClassGenerator/TypeModel.cs 96.95% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51f45a6...2151bac. Read the comment docs.

RedX2501 added 2 commits March 8, 2019 15:35
Prefer `OnPropertyChanged(nameof(<property>))` instead of
OnPropertyChanged("<property>") because the first one is more friendly
towards tools.
@mganss
Copy link
Owner

mganss commented Mar 8, 2019

Thanks. nameof is C# 6. If we go there, we might as well use PropertyChanged?.Invoke(...) 😄 Could you add this to the PR?

@RedX2501
Copy link
Contributor Author

RedX2501 commented Mar 8, 2019

I cannot 😞 because there is no CodeDOM for ?..
See https://stackoverflow.com/questions/55026224/generate-code-with-null-conditional-delegate-invocation

@mganss
Copy link
Owner

mganss commented Mar 8, 2019

You can use CodeSnippetExpression. We're already using it all over the place. IMO CodeDom is technical debt at this point. In hindsight I should have chosen to use some sort of text templating approach.

@codecov-io
Copy link

Codecov Report

Merging #104 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   97.13%   97.13%   +<.01%     
==========================================
  Files          17       17              
  Lines        2964     2970       +6     
==========================================
+ Hits         2879     2885       +6     
  Misses         85       85
Impacted Files Coverage Δ
XmlSchemaClassGenerator/TypeModel.cs 96.95% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51f45a6...3353721. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Mar 11, 2019

Codecov Report

Merging #104 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
- Coverage   97.13%   97.12%   -0.01%     
==========================================
  Files          17       17              
  Lines        2964     2955       -9     
==========================================
- Hits         2879     2870       -9     
  Misses         85       85
Impacted Files Coverage Δ
XmlSchemaClassGenerator/TypeModel.cs 96.91% <100%> (-0.03%) ⬇️
XmlSchemaClassGenerator/GeneratorConfiguration.cs 95.23% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51f45a6...3353721. Read the comment docs.

@mganss mganss merged commit 59cc0ba into mganss:master Mar 11, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants