@@ -126,26 +126,23 @@ void SetUpdateNotificationPage()
126126 if ( UpdateManager . LastCheckError != null || Error != null )
127127 {
128128 NewPageCount = 0 ;
129- //if (ArePagesVisible)
130- {
131- var message = ( UpdateManager . LastCheckError != null )
132- ? UpdateManager . LastCheckError . Message
133- : Error . Message ;
134-
135- // Reports notifications are not available.
136- var channelName = UpdateManager . ChannelName == "" ? "None" : UpdateManager . ChannelName ;
137- var today = DateTime . Now . Date ;
138- new NTitleControl ( page , 1 , 1 , $ "{ today : dd-MMM-yy} ", "Notifications are not available" ) . Add ( ) ;
139- new NRecordControl ( page , "Update mode" , 140 , channelName ) . Add ( ) ;
140- new NRecordControl ( page , "Installed version" , 140 , VersionInfo . VersionOrBuild ) . Add ( ) ;
141-
142- new NHeadingControl ( page , "Notifications are not available" , "red" ) . Add ( ) ;
143- new NTextControl ( page , $ "Error: { message } ") . Add ( ) ;
144- new NTextControl ( page , "Is your Internet connected?" ) . Add ( ) ;
145-
146- new NRetryControl ( page , "Retry" , 140 , "Try again to fetch notifications" , MainForm ) . Add ( ) ;
147- PageList . Add ( page ) ;
148- }
129+ var message = ( UpdateManager . LastCheckError != null )
130+ ? UpdateManager . LastCheckError . Message
131+ : Error . Message ;
132+
133+ // Reports notifications are not available.
134+ var channelName = UpdateManager . ChannelName == "" ? "None" : UpdateManager . ChannelName ;
135+ var today = DateTime . Now . Date ;
136+ new NTitleControl ( page , 1 , 1 , $ "{ today : dd-MMM-yy} ", "Notifications are not available" ) . Add ( ) ;
137+ new NRecordControl ( page , "Update mode" , 140 , channelName ) . Add ( ) ;
138+ new NRecordControl ( page , "Installed version" , 140 , VersionInfo . VersionOrBuild ) . Add ( ) ;
139+
140+ new NHeadingControl ( page , "Notifications are not available" , "red" ) . Add ( ) ;
141+ new NTextControl ( page , $ "Error: { message } ") . Add ( ) ;
142+ new NTextControl ( page , "Is your Internet connected?" ) . Add ( ) ;
143+
144+ new NRetryControl ( page , "Retry" , 140 , "Try again to fetch notifications" , MainForm ) . Add ( ) ;
145+ PageList . Add ( page ) ;
149146 return ;
150147 }
151148
@@ -206,12 +203,6 @@ void SetUpdateNotificationPage()
206203 PageList . Add ( page ) ;
207204 }
208205
209- //private bool IsUpdateAvailable()
210- //{
211- // return UpdateManager.LastUpdate != null
212- // && UpdateManager.LastUpdate.Version != VersionInfo.Version;
213- //}
214-
215206 private void AddItemToPage ( NotificationPage page , Item item )
216207 {
217208 if ( item is Record record )
@@ -238,6 +229,7 @@ private void AddItemToPage(NotificationPage page, Item item)
238229
239230 /// <summary>
240231 /// Returns any check that fails.
232+ /// (Could be extended to include other SystemInfo values.)
241233 /// </summary>
242234 /// <param name="check"></param>
243235 /// <returns></returns>
@@ -270,6 +262,7 @@ private Check CheckExcludes(Check check)
270262
271263 /// <summary>
272264 /// Returns any check that succeeds.
265+ /// (Could be extended to include other SystemInfo values.)
273266 /// </summary>
274267 /// <param name="check"></param>
275268 /// <returns></returns>
@@ -318,7 +311,7 @@ public void DropUnusedUpdateNotifications()
318311 if ( updateModeSetting == "" && lowerUpdateMode == "stable" )
319312 continue ;
320313
321- // Mark unused updates for deletion
314+ // Mark unused updates for deletion outside loop
322315 n . ToDelete = lowerUpdateMode != updateModeSetting ;
323316 }
324317 Notifications . NotificationList . RemoveAll ( n => n . ToDelete ) ;
0 commit comments