void AddProjectBuilderReference(RemoteProjectBuilder remoteBuilder) { if (!remoteBuilder.AddReference()) { RemoveBuilder(remoteBuilder); } }
void RemoveBuilder(RemoteProjectBuilder remoteBuilder) { lock (remoteProjectBuilders) { if (remoteProjectBuilders.TryGetValue(remoteBuilder.File, out Task <RemoteProjectBuilder> foundRemoteBuilder)) { if (foundRemoteBuilder.IsCompleted && foundRemoteBuilder.Result == remoteBuilder) { remoteProjectBuilders.Remove(remoteBuilder.File); } } } }
async Task <RemoteProjectBuilder> CreateRemoteProjectBuilder(string projectFile) { var pid = await LoadProject(projectFile).ConfigureAwait(false); var pb = new RemoteProjectBuilder(projectFile, pid, this, connection); // Unlikely, but it may happen if (IsShuttingDown) { pb.Shutdown(); } return(pb); }
internal async Task UnloadProject(RemoteProjectBuilder remoteBuilder, int projectId) { RemoveBuilder(remoteBuilder); try { await connection.SendMessage(new UnloadProjectRequest { ProjectId = projectId }).ConfigureAwait(false); } catch (Exception ex) { LoggingService.LogError("Project unloading failed", ex); if (!await CheckDisconnected()) { throw; } } }
internal async Task UnloadProject(RemoteProjectBuilder remoteBuilder, ProjectBuilder builder) { lock (remoteProjectBuilders) remoteProjectBuilders.Remove(remoteBuilder); try { await connection.SendMessage(new UnloadProjectRequest { ProjectId = ((ProjectBuilder)builder).ProjectId }); } catch (Exception ex) { LoggingService.LogError("Project unloading failed", ex); if (!await CheckDisconnected()) { throw; } } }
public async Task <RemoteProjectBuilder> CreateRemoteProjectBuilder(string projectFile, string sdksPath) { var builder = await LoadProject(projectFile, sdksPath).ConfigureAwait(false); var pb = new RemoteProjectBuilder(projectFile, builder, this); lock (remoteProjectBuilders) { remoteProjectBuilders.Add(pb); // Unlikely, but it may happen if (IsShuttingDown) { pb.Shutdown(); } } return(pb); }
public RemoteProjectBuilderProxy(RemoteProjectBuilder builder, bool busySet) { this.builder = builder; this.busySet = busySet; }