int IVsSolutionEvents.OnAfterOpenSolution(object pUnkReserved, int fNewSolution) { var port = Network.freeTcpPort(); Logger.LogInfo("Package: Selected {0} as the port for Engine server.", port); TddStud10Host = new TddStud10HostProxy(port, FSharpOption <bool> .None); TddStud10Host.Start(); var cfg = EngineConfigLoader.load(new EngineConfig(), FilePath.NewFilePath(GetSolutionPath())); EngineLoader.Load( this, new EngineParams( HostVersion, cfg, FilePath.NewFilePath(GetSolutionPath()), DateTime.UtcNow )); if (!cfg.IsDisabled) { EngineLoader.EnableEngine(); } else { TelemetryClient.TrackEvent("EngineDisabledOnLoad", new Dictionary <string, string>(), new Dictionary <string, double>()); } Logger.LogInfo("Triggering SnapshotGC on solution load."); SnapshotGC.SweepAsync(FilePath.NewFilePath(Environment.ExpandEnvironmentVariables(cfg.SnapShotRoot))); return(VSConstants.S_OK); }
private void OnBuildDone(vsBuildScope scope, vsBuildAction action) { if (buildEventEnableEngine) { buildEventEnableEngine = false; EngineLoader.EnableEngine(); } }
private void OnBuildBegin(vsBuildScope scope, vsBuildAction action) { if (EngineLoader.IsEngineEnabled()) { buildEventEnableEngine = true; EngineLoader.DisableEngine(); } }
int IVsSolutionEvents.OnBeforeCloseSolution(object pUnkReserved) { EngineLoader.DisableEngine(); EngineLoader.Unload(); TddStud10Host.Dispose(); TddStud10Host = null; IconHost.RunState = RunState.Initial; return(VSConstants.S_OK); }
private void ExecuteChangeTddStud10State(object sender, EventArgs e) { Logger.LogInfo("Changing TddStud10 state..."); if (EngineLoader.IsEngineEnabled()) { EngineLoader.DisableEngine(); SetTddStudioDisable(true); } else { EngineLoader.EnableEngine(); SetTddStudioDisable(false); } }
private void OnBeforeQueryStatusChangeTddStud10State(object sender, EventArgs e) { Logger.LogInfo("Querying for TddStud10 state..."); var cmd = sender as OleMenuCommand; if (cmd == null) { Logger.LogError("sender should have been an OleMenuCommand. This is unexpected."); return; } if (!_dte.Solution.IsOpen) { Logger.LogInfo("Solution is not open."); cmd.Visible = false; return; } cmd.Visible = true; cmd.Text = EngineLoader.IsEngineEnabled() ? Properties.Resources.DisableTddStud10State : Properties.Resources.EnableTddStud10State; }