77using System ;
88using System . Collections . Generic ;
99using System . ComponentModel ;
10- using System . Diagnostics ;
11- using System . Diagnostics . CodeAnalysis ;
1210using System . Runtime . CompilerServices ;
1311using System . Threading . Tasks ;
1412
@@ -20,15 +18,12 @@ namespace Microsoft.Toolkit.Mvvm.ComponentModel
2018 public abstract class NotifyPropertyChanged : INotifyPropertyChanged
2119 {
2220 /// <inheritdoc cref="INotifyPropertyChanged.PropertyChanged"/>
23- [ ExcludeFromCodeCoverage ]
2421 public event PropertyChangedEventHandler ? PropertyChanged ;
2522
2623 /// <summary>
2724 /// Raises the <see cref="PropertyChanged"/> event.
2825 /// </summary>
2926 /// <param name="e">The input <see cref="PropertyChangedEventArgs"/> instance.</param>
30- [ DebuggerNonUserCode ]
31- [ ExcludeFromCodeCoverage ]
3227 protected virtual void OnPropertyChanged ( PropertyChangedEventArgs e )
3328 {
3429 PropertyChanged ? . Invoke ( this , e ) ;
@@ -38,8 +33,6 @@ protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
3833 /// Raises the <see cref="PropertyChanged"/> event.
3934 /// </summary>
4035 /// <param name="propertyName">(optional) The name of the property that changed.</param>
41- [ DebuggerNonUserCode ]
42- [ ExcludeFromCodeCoverage ]
4336 protected void OnPropertyChanged ( [ CallerMemberName ] string ? propertyName = null )
4437 {
4538 OnPropertyChanged ( new PropertyChangedEventArgs ( propertyName ) ) ;
@@ -57,8 +50,6 @@ protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
5750 /// <remarks>
5851 /// The <see cref="PropertyChanged"/> event is not raised if the current and new value for the target property are the same.
5952 /// </remarks>
60- [ DebuggerNonUserCode ]
61- [ ExcludeFromCodeCoverage ]
6253 protected bool SetProperty < T > ( ref T field , T newValue , [ CallerMemberName ] string ? propertyName = null )
6354 {
6455 if ( EqualityComparer < T > . Default . Equals ( field , newValue ) )
@@ -84,8 +75,6 @@ protected bool SetProperty<T>(ref T field, T newValue, [CallerMemberName] string
8475 /// <param name="comparer">The <see cref="IEqualityComparer{T}"/> instance to use to compare the input values.</param>
8576 /// <param name="propertyName">(optional) The name of the property that changed.</param>
8677 /// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
87- [ DebuggerNonUserCode ]
88- [ ExcludeFromCodeCoverage ]
8978 protected bool SetProperty < T > ( ref T field , T newValue , IEqualityComparer < T > comparer , [ CallerMemberName ] string ? propertyName = null )
9079 {
9180 if ( comparer . Equals ( field , newValue ) )
@@ -121,8 +110,6 @@ protected bool SetProperty<T>(ref T field, T newValue, IEqualityComparer<T> comp
121110 /// <remarks>
122111 /// The <see cref="PropertyChanged"/> event is not raised if the current and new value for the target property are the same.
123112 /// </remarks>
124- [ DebuggerNonUserCode ]
125- [ ExcludeFromCodeCoverage ]
126113 protected bool SetProperty < T > ( T oldValue , T newValue , Action < T > callback , [ CallerMemberName ] string ? propertyName = null )
127114 {
128115 if ( EqualityComparer < T > . Default . Equals ( oldValue , newValue ) )
@@ -149,8 +136,6 @@ protected bool SetProperty<T>(T oldValue, T newValue, Action<T> callback, [Calle
149136 /// <param name="callback">A callback to invoke to update the property value.</param>
150137 /// <param name="propertyName">(optional) The name of the property that changed.</param>
151138 /// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
152- [ DebuggerNonUserCode ]
153- [ ExcludeFromCodeCoverage ]
154139 protected bool SetProperty < T > ( T oldValue , T newValue , IEqualityComparer < T > comparer , Action < T > callback , [ CallerMemberName ] string ? propertyName = null )
155140 {
156141 if ( comparer . Equals ( oldValue , newValue ) )
@@ -217,8 +202,6 @@ protected bool SetProperty<T>(T oldValue, T newValue, IEqualityComparer<T> compa
217202 /// <remarks>
218203 /// The <see cref="PropertyChanged"/> event is not raised if the current and new value for the target property are the same.
219204 /// </remarks>
220- [ DebuggerNonUserCode ]
221- [ ExcludeFromCodeCoverage ]
222205 protected bool SetProperty < TModel , T > ( T oldValue , T newValue , TModel model , Action < TModel , T > callback , [ CallerMemberName ] string ? propertyName = null )
223206 where TModel : class
224207 {
@@ -250,8 +233,6 @@ protected bool SetProperty<TModel, T>(T oldValue, T newValue, TModel model, Acti
250233 /// <param name="callback">The callback to invoke to set the target property value, if a change has occurred.</param>
251234 /// <param name="propertyName">(optional) The name of the property that changed.</param>
252235 /// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
253- [ DebuggerNonUserCode ]
254- [ ExcludeFromCodeCoverage ]
255236 protected bool SetProperty < TModel , T > ( T oldValue , T newValue , IEqualityComparer < T > comparer , TModel model , Action < TModel , T > callback , [ CallerMemberName ] string ? propertyName = null )
256237 where TModel : class
257238 {
@@ -299,8 +280,6 @@ protected bool SetProperty<TModel, T>(T oldValue, T newValue, IEqualityComparer<
299280 /// <paramref name="taskNotifier"/> is different than the previous one, and it does not mean the new
300281 /// <see cref="Task"/> instance passed as argument is in any particular state.
301282 /// </remarks>
302- [ DebuggerNonUserCode ]
303- [ ExcludeFromCodeCoverage ]
304283 protected bool SetPropertyAndNotifyOnCompletion ( ref TaskNotifier ? taskNotifier , Task ? newValue , [ CallerMemberName ] string ? propertyName = null )
305284 {
306285 return SetPropertyAndNotifyOnCompletion ( taskNotifier ??= new ( ) , newValue , static _ => { } , propertyName ) ;
@@ -321,8 +300,6 @@ protected bool SetPropertyAndNotifyOnCompletion(ref TaskNotifier? taskNotifier,
321300 /// <remarks>
322301 /// The <see cref="PropertyChanged"/> event is not raised if the current and new value for the target property are the same.
323302 /// </remarks>
324- [ DebuggerNonUserCode ]
325- [ ExcludeFromCodeCoverage ]
326303 protected bool SetPropertyAndNotifyOnCompletion ( ref TaskNotifier ? taskNotifier , Task ? newValue , Action < Task ? > callback , [ CallerMemberName ] string ? propertyName = null )
327304 {
328305 return SetPropertyAndNotifyOnCompletion ( taskNotifier ??= new ( ) , newValue , callback , propertyName ) ;
@@ -361,8 +338,6 @@ protected bool SetPropertyAndNotifyOnCompletion(ref TaskNotifier? taskNotifier,
361338 /// <paramref name="taskNotifier"/> is different than the previous one, and it does not mean the new
362339 /// <see cref="Task{TResult}"/> instance passed as argument is in any particular state.
363340 /// </remarks>
364- [ DebuggerNonUserCode ]
365- [ ExcludeFromCodeCoverage ]
366341 protected bool SetPropertyAndNotifyOnCompletion < T > ( ref TaskNotifier < T > ? taskNotifier , Task < T > ? newValue , [ CallerMemberName ] string ? propertyName = null )
367342 {
368343 return SetPropertyAndNotifyOnCompletion ( taskNotifier ??= new ( ) , newValue , static _ => { } , propertyName ) ;
@@ -384,8 +359,6 @@ protected bool SetPropertyAndNotifyOnCompletion<T>(ref TaskNotifier<T>? taskNoti
384359 /// <remarks>
385360 /// The <see cref="PropertyChanged"/> event is not raised if the current and new value for the target property are the same.
386361 /// </remarks>
387- [ DebuggerNonUserCode ]
388- [ ExcludeFromCodeCoverage ]
389362 protected bool SetPropertyAndNotifyOnCompletion < T > ( ref TaskNotifier < T > ? taskNotifier , Task < T > ? newValue , Action < Task < T > ? > callback , [ CallerMemberName ] string ? propertyName = null )
390363 {
391364 return SetPropertyAndNotifyOnCompletion ( taskNotifier ??= new ( ) , newValue , callback , propertyName ) ;
@@ -400,8 +373,6 @@ protected bool SetPropertyAndNotifyOnCompletion<T>(ref TaskNotifier<T>? taskNoti
400373 /// <param name="callback">A callback to invoke to update the property value.</param>
401374 /// <param name="propertyName">(optional) The name of the property that changed.</param>
402375 /// <returns><see langword="true"/> if the property was changed, <see langword="false"/> otherwise.</returns>
403- [ DebuggerNonUserCode ]
404- [ ExcludeFromCodeCoverage ]
405376 private bool SetPropertyAndNotifyOnCompletion < TTask > ( ITaskNotifier < TTask > taskNotifier , TTask ? newValue , Action < TTask ? > callback , [ CallerMemberName ] string ? propertyName = null )
406377 where TTask : Task
407378 {
@@ -456,16 +427,12 @@ private interface ITaskNotifier<TTask>
456427 /// <summary>
457428 /// Gets or sets the wrapped <typeparamref name="TTask"/> value.
458429 /// </summary>
459- [ DebuggerNonUserCode ]
460- [ ExcludeFromCodeCoverage ]
461430 TTask ? Task { get ; set ; }
462431 }
463432
464433 /// <summary>
465434 /// A wrapping class that can hold a <see cref="Task"/> value.
466435 /// </summary>
467- [ DebuggerNonUserCode ]
468- [ ExcludeFromCodeCoverage ]
469436 protected sealed class TaskNotifier : ITaskNotifier < Task >
470437 {
471438 /// <summary>
@@ -498,8 +465,6 @@ internal TaskNotifier()
498465 /// A wrapping class that can hold a <see cref="Task{T}"/> value.
499466 /// </summary>
500467 /// <typeparam name="T">The type of value for the wrapped <see cref="Task{T}"/> instance.</typeparam>
501- [ DebuggerNonUserCode ]
502- [ ExcludeFromCodeCoverage ]
503468 protected sealed class TaskNotifier < T > : ITaskNotifier < Task < T > >
504469 {
505470 /// <summary>
0 commit comments