/// <summary> /// Event triggered when job monitor entry's instance is exited /// </summary> /// <param name="sender">indicating the sender</param> /// <param name="e">indicating the event args</param> private void JobMonitorEntry_Exit(object sender, EventArgs e) { AzureBatchJobMonitorEntry entry = (AzureBatchJobMonitorEntry)sender; Debug.Assert(entry != null, "[AzureBatchSchedulerDelegation] Sender should be an instance of JobMonitorEntry class."); lock (this.JobMonitors) { this.JobMonitors.Remove(entry.SessionId); } entry.Exit -= new EventHandler(this.JobMonitorEntry_Exit); entry.Close(); Trace.TraceInformation($"[AzureBatchSchedulerDelegation] End: JobMonitorEntry Exit."); }