1- using Elasticsearch . Net ;
2- using System ;
1+ using System ;
32using System . Diagnostics ;
43using System . Linq ;
54using System . Text . RegularExpressions ;
65using System . Threading ;
6+ using Elasticsearch . Net ;
77
88namespace Nest
99{
@@ -109,7 +109,8 @@ public void Dispose()
109109 protected virtual void Dispose ( bool disposing )
110110 {
111111 if ( _disposed ) return ;
112- if ( _timer != null ) _timer . Dispose ( ) ;
112+ _timer ? . Dispose ( ) ;
113+
113114 if ( _restoreStatusHumbleObject != null )
114115 {
115116 _restoreStatusHumbleObject . Next -= _nextEventHandlers ;
@@ -131,7 +132,7 @@ protected virtual void Dispose(bool disposing)
131132
132133 public class RestoreNextEventArgs : EventArgs
133134 {
134- public IRecoveryStatusResponse RecoveryStatusResponse { get ; private set ; }
135+ public IRecoveryStatusResponse RecoveryStatusResponse { get ; }
135136
136137 public RestoreNextEventArgs ( IRecoveryStatusResponse recoveryStatusResponse )
137138 {
@@ -141,7 +142,7 @@ public RestoreNextEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
141142
142143 public class RestoreCompletedEventArgs : EventArgs
143144 {
144- public IRecoveryStatusResponse RecoveryStatusResponse { get ; private set ; }
145+ public IRecoveryStatusResponse RecoveryStatusResponse { get ; }
145146
146147 public RestoreCompletedEventArgs ( IRecoveryStatusResponse recoveryStatusResponse )
147148 {
@@ -151,7 +152,7 @@ public RestoreCompletedEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
151152
152153 public class RestoreErrorEventArgs : EventArgs
153154 {
154- public Exception Exception { get ; private set ; }
155+ public Exception Exception { get ; }
155156
156157 public RestoreErrorEventArgs ( Exception exception )
157158 {
@@ -220,19 +221,19 @@ public void CheckStatus()
220221 protected virtual void OnNext ( RestoreNextEventArgs nextEventArgs )
221222 {
222223 var handler = Next ;
223- if ( handler != null ) handler ( this , nextEventArgs ) ;
224+ handler ? . Invoke ( this , nextEventArgs ) ;
224225 }
225226
226227 protected virtual void OnCompleted ( RestoreCompletedEventArgs completedEventArgs )
227228 {
228229 var handler = Completed ;
229- if ( handler != null ) handler ( this , completedEventArgs ) ;
230+ handler ? . Invoke ( this , completedEventArgs ) ;
230231 }
231232
232233 protected virtual void OnError ( RestoreErrorEventArgs errorEventArgs )
233234 {
234235 var handler = Error ;
235- if ( handler != null ) handler ( this , errorEventArgs ) ;
236+ handler ? . Invoke ( this , errorEventArgs ) ;
236237 }
237238 }
238239}
0 commit comments