public void OnConfigurationRemoved(Configuration configuration) { lock (Lock) { VerifyDisposed(); _collection.Remove(configuration.Uid); _configurationRemovedEvent.Invoke(() => new ConfigurationEventArgs(configuration)); } }
internal ISession Create(IConfiguration configuration) { lock (Lock) { VerifyDisposed(); ConfigurationSettings configurationSettings = configuration.ConfigurationSettings; Session session = new Session(configurationSettings, this, _application); _collection.Add(session.Uid, session); _sessionCreatedEvent.Invoke(() => new SessionEventArgs(session)); return(session); } }
public IConfiguration Create(ConfigurationSettings settings) { lock (Lock) { VerifyDisposed(); settings.Validate(); if (_collection.ContainsKey(settings.ConfigurationUid)) { throw new ConfigurationAlreadyExistsException(settings.ConfigurationUid); } IProfilingTarget profilingTarget = _profilingTargets[settings.ProfilingTargetSettings.Uid]; Configuration configuration = new Configuration(settings, this, profilingTarget, _frameworks, _application); _collection.Add(configuration.Uid, configuration); _configurationCreatedEvent.Invoke(() => new ConfigurationEventArgs(configuration)); return(configuration); } }
internal void OnSessionRemovedChanged(ISession session) { bool removed; lock (Lock) { VerifyDisposed(); removed = _collection.Remove(session.Uid); } if (removed) { _sessionRemovedEvent.Invoke(() => new SessionEventArgs(session)); } else { LoggingProvider.Current.Log(TraceEventType.Warning, ErrorMessageFormatter.SessionAlreadyRemovedFromCollection(session.Uid)); } }
internal void OnSessionStateChanged(ISession session) { _sessionStateChangedEvent.Invoke(() => new SessionEventArgs(session)); }