private void OnControllerTargetStopped(object sender, ProfilingTargetControllerEventArgs e) { VerifyDisposed(); IProfilingTargetController controller = (IProfilingTargetController)sender; lock (_controllers) { _controllers.Remove(controller); } controller.TargetStopped -= OnControllerTargetStopped; }
public void Activate() { VerifyDisposed(); IProfilingTargetAdapter adapter = _profilingTarget.GetSafeAdapter(); IProfilingTargetController controller = adapter.CreateController(_configurationSettings); //Select all Frameworks that involved into profiling and notify them foreach (FrameworkSettings frameworkSettings in _configurationSettings.FrameworksSettings) { IFramework framework = _frameworks[frameworkSettings.Uid]; IFrameworkAdapter frameworkAdapter = framework.GetSafeAdapter(); frameworkAdapter.ConfigureForProfiling(_configurationSettings); } //Start profiling controller.Start(); controller.TargetStopped += OnControllerTargetStopped; lock (_controllers) { _controllers.Add(controller); } }
public static void RaiseEvent(EventHandler <ProfilingTargetControllerEventArgs> handler, IProfilingTargetController sender) { EventExtensions.RaiseEventSafeAndSilent(handler, sender, () => new ProfilingTargetControllerEventArgs()); }