Exemplo n.º 1
0
 void AddProjectBuilderReference(RemoteProjectBuilder remoteBuilder)
 {
     if (!remoteBuilder.AddReference())
     {
         RemoveBuilder(remoteBuilder);
     }
 }
Exemplo n.º 2
0
 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);
             }
         }
     }
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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;
                }
            }
        }
Exemplo n.º 5
0
        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;
                }
            }
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 public RemoteProjectBuilderProxy(RemoteProjectBuilder builder, bool busySet)
 {
     this.builder = builder;
     this.busySet = busySet;
 }