@@ -169,11 +169,12 @@ public void SubmitEvent(Event ev, ContextData pluginContextData = null) {
169
169
_log . Value . FormattedTrace ( typeof ( ExceptionlessClient ) , "Submitting event: type={0}{1}" , ev . Type , ! String . IsNullOrEmpty ( ev . ReferenceId ) ? " refid=" + ev . ReferenceId : String . Empty ) ;
170
170
_queue . Value . Enqueue ( ev ) ;
171
171
172
- if ( String . IsNullOrEmpty ( ev . ReferenceId ) )
173
- return ;
172
+ if ( ! String . IsNullOrEmpty ( ev . ReferenceId ) ) {
173
+ _log . Value . FormattedTrace ( typeof ( ExceptionlessClient ) , "Setting last reference id '{0}'" , ev . ReferenceId ) ;
174
+ _lastReferenceIdManager . Value . SetLast ( ev . ReferenceId ) ;
175
+ }
174
176
175
- _log . Value . FormattedTrace ( typeof ( ExceptionlessClient ) , "Setting last reference id '{0}'" , ev . ReferenceId ) ;
176
- _lastReferenceIdManager . Value . SetLast ( ev . ReferenceId ) ;
177
+ OnSubmittedEvent ( new EventSubmittingEventArgs ( this , ev , pluginContextData ) ) ;
177
178
}
178
179
179
180
/// <summary>Creates a new instance of <see cref="Event" />.</summary>
@@ -225,6 +226,31 @@ protected void OnSubmittingEvent(EventSubmittingEventArgs e) {
225
226
}
226
227
}
227
228
229
+ /// <summary>
230
+ /// Occurs when the event has been submitted.
231
+ /// </summary>
232
+ public event EventHandler < EventSubmittingEventArgs > SubmittedEvent ;
233
+
234
+ /// <summary>
235
+ /// Raises the <see cref="SubmittedEvent" /> event.
236
+ /// </summary>
237
+ /// <param name="e">The <see cref="EventSubmittingEventArgs" /> instance containing the event data.</param>
238
+ protected void OnSubmittedEvent ( EventSubmittingEventArgs e ) {
239
+ if ( SubmittedEvent == null )
240
+ return ;
241
+
242
+ var handlers = SubmittedEvent . GetInvocationList ( ) ;
243
+ foreach ( var handler in handlers ) {
244
+ try {
245
+ handler . DynamicInvoke ( this , e ) ;
246
+ if ( e . Cancel )
247
+ return ;
248
+ } catch ( Exception ex ) {
249
+ _log . Value . FormattedError ( typeof ( ExceptionlessClient ) , ex , "Error while invoking SubmittedEvent handler: {0}" , ex . Message ) ;
250
+ }
251
+ }
252
+ }
253
+
228
254
void IDisposable . Dispose ( ) {
229
255
Configuration . Resolver . Dispose ( ) ;
230
256
}
0 commit comments