1
- using Elasticsearch . Net ;
2
- using System ;
1
+ using System ;
3
2
using System . Diagnostics ;
4
3
using System . Linq ;
5
4
using System . Text . RegularExpressions ;
6
5
using System . Threading ;
6
+ using Elasticsearch . Net ;
7
7
8
8
namespace Nest
9
9
{
@@ -109,7 +109,8 @@ public void Dispose()
109
109
protected virtual void Dispose ( bool disposing )
110
110
{
111
111
if ( _disposed ) return ;
112
- if ( _timer != null ) _timer . Dispose ( ) ;
112
+ _timer ? . Dispose ( ) ;
113
+
113
114
if ( _restoreStatusHumbleObject != null )
114
115
{
115
116
_restoreStatusHumbleObject . Next -= _nextEventHandlers ;
@@ -131,7 +132,7 @@ protected virtual void Dispose(bool disposing)
131
132
132
133
public class RestoreNextEventArgs : EventArgs
133
134
{
134
- public IRecoveryStatusResponse RecoveryStatusResponse { get ; private set ; }
135
+ public IRecoveryStatusResponse RecoveryStatusResponse { get ; }
135
136
136
137
public RestoreNextEventArgs ( IRecoveryStatusResponse recoveryStatusResponse )
137
138
{
@@ -141,7 +142,7 @@ public RestoreNextEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
141
142
142
143
public class RestoreCompletedEventArgs : EventArgs
143
144
{
144
- public IRecoveryStatusResponse RecoveryStatusResponse { get ; private set ; }
145
+ public IRecoveryStatusResponse RecoveryStatusResponse { get ; }
145
146
146
147
public RestoreCompletedEventArgs ( IRecoveryStatusResponse recoveryStatusResponse )
147
148
{
@@ -151,7 +152,7 @@ public RestoreCompletedEventArgs(IRecoveryStatusResponse recoveryStatusResponse)
151
152
152
153
public class RestoreErrorEventArgs : EventArgs
153
154
{
154
- public Exception Exception { get ; private set ; }
155
+ public Exception Exception { get ; }
155
156
156
157
public RestoreErrorEventArgs ( Exception exception )
157
158
{
@@ -220,19 +221,19 @@ public void CheckStatus()
220
221
protected virtual void OnNext ( RestoreNextEventArgs nextEventArgs )
221
222
{
222
223
var handler = Next ;
223
- if ( handler != null ) handler ( this , nextEventArgs ) ;
224
+ handler ? . Invoke ( this , nextEventArgs ) ;
224
225
}
225
226
226
227
protected virtual void OnCompleted ( RestoreCompletedEventArgs completedEventArgs )
227
228
{
228
229
var handler = Completed ;
229
- if ( handler != null ) handler ( this , completedEventArgs ) ;
230
+ handler ? . Invoke ( this , completedEventArgs ) ;
230
231
}
231
232
232
233
protected virtual void OnError ( RestoreErrorEventArgs errorEventArgs )
233
234
{
234
235
var handler = Error ;
235
- if ( handler != null ) handler ( this , errorEventArgs ) ;
236
+ handler ? . Invoke ( this , errorEventArgs ) ;
236
237
}
237
238
}
238
239
}
0 commit comments