public ICruiseProjectManager Create(CCTrayProject project, IDictionary <BuildServer, ICruiseServerManager> serverManagers)
        {
            BuildServer server = project.BuildServer;

            switch (server.Transport)
            {
            case BuildServerTransport.Remoting:
            {
                var client = GenerateRemotingClient(server);
                return(new RemotingCruiseProjectManager(client, project.ProjectName));
            }

            case BuildServerTransport.Extension:
                ITransportExtension extensionInstance = ExtensionHelpers.RetrieveExtension(server.ExtensionName);
                extensionInstance.Settings      = server.ExtensionSettings;
                extensionInstance.Configuration = server;
                return(extensionInstance.RetrieveProjectManager(project.ProjectName));

            default:
            {
                var client = GenerateHttpClient(server);
                return(new HttpCruiseProjectManager(client, project.ProjectName, serverManagers[server]));
            }
            }
        }
        public ICruiseServerManager Create(BuildServer buildServer)
        {
            switch (buildServer.Transport)
            {
            case BuildServerTransport.Remoting:
            {
                var manager = GenerateRemotingClient(buildServer);
                return(new CachingCruiseServerManager(new RemotingCruiseServerManager(manager, buildServer)));
            }

            case BuildServerTransport.Extension:
                ITransportExtension extensionInstance = ExtensionHelpers.RetrieveExtension(buildServer.ExtensionName);
                extensionInstance.Settings      = buildServer.ExtensionSettings;
                extensionInstance.Configuration = buildServer;
                return(extensionInstance.RetrieveServerManager());

            default:
            {
                var manager = GenerateHttpClient(buildServer);
                return(new CachingCruiseServerManager(
                           new HttpCruiseServerManager(manager, buildServer)));
            }
            }
        }
 public ExtensionTransportProjectListRetriever(string extensionName)
 {
     this.extensionInstance = ExtensionHelpers.RetrieveExtension(extensionName);
 }