1212using System . Reflection ; // ConstructorInfo
1313#endif
1414
15+ using DiagnosticsDebug = System . Diagnostics . Debug ;
16+
1517namespace Microsoft . Toolkit . Uwp . UI . Data . Utilities
1618{
1719 /// <summary>
@@ -563,7 +565,7 @@ public object AddNew()
563565 BeginAddNew ( newItem , index ) ;
564566 }
565567
566- Debug . Assert ( _newItemIndex != - 2 && object . Equals ( newItem , _newItem ) , "AddNew did not raise expected events" ) ;
568+ DiagnosticsDebug . Assert ( _newItemIndex != - 2 && object . Equals ( newItem , _newItem ) , "AddNew did not raise expected events" ) ;
567569
568570 MoveCurrentTo ( newItem ) ;
569571
@@ -588,7 +590,7 @@ public object AddNew()
588590 // related to AddNew. This method is called from ProcessCollectionChanged.
589591 private void BeginAddNew ( object newItem , int index )
590592 {
591- Debug . Assert ( _newItemIndex == - 2 && _newItem == NoNewItem , "unexpected call to BeginAddNew" ) ;
593+ DiagnosticsDebug . Assert ( _newItemIndex == - 2 && _newItem == NoNewItem , "unexpected call to BeginAddNew" ) ;
592594
593595 // remember the new item and its position in the underlying list
594596 SetNewItem ( newItem ) ;
@@ -810,7 +812,7 @@ private void SetNewItem(object item)
810812 {
811813 if ( ! object . Equals ( item , _newItem ) )
812814 {
813- Debug . Assert ( item == NoNewItem || this . _newItem == NoNewItem , "Old and new _newItem values are unexpectedly different from NoNewItem" ) ;
815+ DiagnosticsDebug . Assert ( item == NoNewItem || this . _newItem == NoNewItem , "Old and new _newItem values are unexpectedly different from NoNewItem" ) ;
814816 _newItem = item ;
815817
816818 OnPropertyChanged ( CurrentAddItemPropertyName ) ;
@@ -1193,7 +1195,7 @@ private void SetEditItem(object item)
11931195 {
11941196 if ( ! object . Equals ( item , _editItem ) )
11951197 {
1196- Debug . Assert ( item == null || _editItem == null , "Old and new _editItem values are unexpectedly non null" ) ;
1198+ DiagnosticsDebug . Assert ( item == null || _editItem == null , "Old and new _editItem values are unexpectedly non null" ) ;
11971199 _editItem = item ;
11981200
11991201 OnPropertyChanged ( CurrentEditItemPropertyName ) ;
@@ -1543,7 +1545,7 @@ private void ProcessCollectionChangedWithAdjustedIndex(EffectiveNotifyCollection
15431545 break ;
15441546
15451547 default :
1546- Debug . Assert ( false , "Unexpected Effective Collection Change Action" ) ;
1548+ DiagnosticsDebug . Assert ( false , "Unexpected Effective Collection Change Action" ) ;
15471549 break ;
15481550 }
15491551
@@ -1571,7 +1573,7 @@ private void ProcessCollectionChangedWithAdjustedIndex(EffectiveNotifyCollection
15711573 // so any changes to the current item will only be raised once, and from this method
15721574 // _currentChangedMonitor is used to guard whether the CurrentChanged and CurrentChanging event can be fired
15731575 // so by entering it we're preventing the base calls from firing those events.
1574- Debug . Assert ( ! CurrentChangedMonitor . Busy , "Expected _currentChangedMonitor.Busy is false." ) ;
1576+ DiagnosticsDebug . Assert ( ! CurrentChangedMonitor . Busy , "Expected _currentChangedMonitor.Busy is false." ) ;
15751577
15761578 CurrentChangedMonitor . Enter ( ) ;
15771579 using ( CurrentChangedMonitor )
@@ -1910,23 +1912,23 @@ private void Debug_ValidateCollectionChangedEventArgs(NotifyCollectionChangedEve
19101912 switch ( e . Action )
19111913 {
19121914 case NotifyCollectionChangedAction . Add :
1913- Debug . Assert ( e . NewItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.NewItems.Count for Add action" ) ;
1915+ DiagnosticsDebug . Assert ( e . NewItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.NewItems.Count for Add action" ) ;
19141916 break ;
19151917
19161918 case NotifyCollectionChangedAction . Remove :
1917- Debug . Assert ( e . OldItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.OldItems.Count for Remove action" ) ;
1919+ DiagnosticsDebug . Assert ( e . OldItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.OldItems.Count for Remove action" ) ;
19181920 break ;
19191921
19201922 case NotifyCollectionChangedAction . Replace :
1921- Debug . Assert ( e . OldItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.OldItems.Count for Replace action" ) ;
1922- Debug . Assert ( e . NewItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.NewItems.Count for Replace action" ) ;
1923+ DiagnosticsDebug . Assert ( e . OldItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.OldItems.Count for Replace action" ) ;
1924+ DiagnosticsDebug . Assert ( e . NewItems . Count == 1 , "Unexpected NotifyCollectionChangedEventArgs.NewItems.Count for Replace action" ) ;
19231925 break ;
19241926
19251927 case NotifyCollectionChangedAction . Reset :
19261928 break ;
19271929
19281930 default :
1929- Debug . Assert ( false , "Unexpected NotifyCollectionChangedEventArgs action" ) ;
1931+ DiagnosticsDebug . Assert ( false , "Unexpected NotifyCollectionChangedEventArgs action" ) ;
19301932 break ;
19311933 }
19321934 }
@@ -2308,7 +2310,7 @@ private void SetSortDescriptions(SortDescriptionCollection descriptions)
23082310
23092311 if ( _sort != null )
23102312 {
2311- Debug . Assert ( _sort . Count == 0 , "must be empty SortDescription collection" ) ;
2313+ DiagnosticsDebug . Assert ( _sort . Count == 0 , "must be empty SortDescription collection" ) ;
23122314 ( ( INotifyCollectionChanged ) _sort ) . CollectionChanged += new NotifyCollectionChangedEventHandler ( SortDescriptionsChanged ) ;
23132315 }
23142316 }
0 commit comments