private static ProjectInfo CreateProjectInfo(ProjectInfoXml projectInfoXml) { List <string> allowedEnvironmentNames = (projectInfoXml.AllowedEnvironments ?? "") .Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries) .ToList(); var uberDeployerAgentProjectInfoXml = projectInfoXml as UberDeployerAgentProjectInfoXml; if (uberDeployerAgentProjectInfoXml != null) { return (new UberDeployerAgentProjectInfo( uberDeployerAgentProjectInfoXml.Name, uberDeployerAgentProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, uberDeployerAgentProjectInfoXml.ArtifactsRepositoryDirName, uberDeployerAgentProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, uberDeployerAgentProjectInfoXml.NtServiceName, uberDeployerAgentProjectInfoXml.NtServiceDirName, uberDeployerAgentProjectInfoXml.NtServiceDisplayName, uberDeployerAgentProjectInfoXml.NtServiceExeName, uberDeployerAgentProjectInfoXml.NtServiceUserId)); } var ntServiceProjectInfoXml = projectInfoXml as NtServiceProjectInfoXml; if (ntServiceProjectInfoXml != null) { return (new NtServiceProjectInfo( ntServiceProjectInfoXml.Name, ntServiceProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, ntServiceProjectInfoXml.ArtifactsRepositoryDirName, ntServiceProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, ntServiceProjectInfoXml.NtServiceName, ntServiceProjectInfoXml.NtServiceDirName, ntServiceProjectInfoXml.NtServiceDisplayName, ntServiceProjectInfoXml.NtServiceExeName, ntServiceProjectInfoXml.NtServiceUserId, ntServiceProjectInfoXml.ExtensionsDirName, ntServiceProjectInfoXml.DependentProjects)); } var webAppProjectInfoXml = projectInfoXml as WebAppProjectInfoXml; if (webAppProjectInfoXml != null) { return (new WebAppProjectInfo( webAppProjectInfoXml.Name, webAppProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, webAppProjectInfoXml.ArtifactsRepositoryDirName, webAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, webAppProjectInfoXml.AppPoolId, webAppProjectInfoXml.WebSiteName, webAppProjectInfoXml.WebAppDirName, webAppProjectInfoXml.WebAppName, webAppProjectInfoXml.DependentProjects)); } var schedulerAppProjectInfoXml = projectInfoXml as SchedulerAppProjectInfoXml; if (schedulerAppProjectInfoXml != null) { return (new SchedulerAppProjectInfo( schedulerAppProjectInfoXml.Name, schedulerAppProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, schedulerAppProjectInfoXml.ArtifactsRepositoryDirName, schedulerAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, schedulerAppProjectInfoXml.SchedulerAppDirName, schedulerAppProjectInfoXml.SchedulerAppExeName, schedulerAppProjectInfoXml.SchedulerAppTasks .Select( x => new SchedulerAppTask( x.Name, x.ExecutableName, x.UserId, x.ScheduledHour, x.ScheduledMinute, x.ExecutionTimeLimitInMinutes, x.Repetition.Enabled ? Repetition.CreateEnabled( TimeSpan.Parse(x.Repetition.Interval), TimeSpan.Parse(x.Repetition.Duration), x.Repetition.StopAtDurationEnd) : Repetition.CreatedDisabled())), schedulerAppProjectInfoXml.DependentProjects)); } var terminalAppProjectInfoXml = projectInfoXml as TerminalAppProjectInfoXml; if (terminalAppProjectInfoXml != null) { return (new TerminalAppProjectInfo( terminalAppProjectInfoXml.Name, terminalAppProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, terminalAppProjectInfoXml.ArtifactsRepositoryDirName, terminalAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, terminalAppProjectInfoXml.TerminalAppName, terminalAppProjectInfoXml.TerminalAppDirName, terminalAppProjectInfoXml.TerminalAppExeName, terminalAppProjectInfoXml.DependentProjects)); } var dbProjectInfoXml = projectInfoXml as DbProjectInfoXml; if (dbProjectInfoXml != null) { return (new DbProjectInfo( dbProjectInfoXml.Name, dbProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, dbProjectInfoXml.ArtifactsRepositoryDirName, dbProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, dbProjectInfoXml.DbName, dbProjectInfoXml.DatabaseServerId, dbProjectInfoXml.IsTransacional, dbProjectInfoXml.DacpacFile, dbProjectInfoXml.Users, dbProjectInfoXml.DependentProjects)); } var extensionProjectXml = projectInfoXml as ExtensionProjectInfoXml; if (extensionProjectXml != null) { return (new ExtensionProjectInfo( extensionProjectXml.Name, extensionProjectXml.ArtifactsRepositoryName, allowedEnvironmentNames, extensionProjectXml.ArtifactsRepositoryDirName, true, extensionProjectXml.ExtendedProjectName, extensionProjectXml.DependentProjects)); } var powerShellScriptProjectInfoXml = projectInfoXml as PowerShellScriptProjectInfoXml; if (powerShellScriptProjectInfoXml != null) { return (new PowerShellScriptProjectInfo( powerShellScriptProjectInfoXml.Name, powerShellScriptProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, powerShellScriptProjectInfoXml.ArtifactsRepositoryDirName, powerShellScriptProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, ConvertTargetMachine(powerShellScriptProjectInfoXml.TargetMachine), powerShellScriptProjectInfoXml.ScriptName, powerShellScriptProjectInfoXml.IsRemote, powerShellScriptProjectInfoXml.DependentProjects)); } throw new NotSupportedException(string.Format("Project type '{0}' is not supported.", projectInfoXml.GetType())); }
private static ProjectInfo CreateProjectInfo(ProjectInfoXml projectInfoXml) { var ntServiceProjectInfoXml = projectInfoXml as NtServiceProjectInfoXml; if (ntServiceProjectInfoXml != null) { return new NtServiceProjectInfo( ntServiceProjectInfoXml.Name, ntServiceProjectInfoXml.ArtifactsRepositoryName, ntServiceProjectInfoXml.ArtifactsRepositoryDirName, ntServiceProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, ntServiceProjectInfoXml.NtServiceName, ntServiceProjectInfoXml.NtServiceDirName, ntServiceProjectInfoXml.NtServiceDisplayName, ntServiceProjectInfoXml.NtServiceExeName, ntServiceProjectInfoXml.NtServiceUserId); } var webAppProjectInfoXml = projectInfoXml as WebAppProjectInfoXml; if (webAppProjectInfoXml != null) { return new WebAppProjectInfo( webAppProjectInfoXml.Name, webAppProjectInfoXml.ArtifactsRepositoryName, webAppProjectInfoXml.ArtifactsRepositoryDirName, webAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, webAppProjectInfoXml.IisSiteName, webAppProjectInfoXml.WebAppName, webAppProjectInfoXml.WebAppDirName, new IisAppPoolInfo( webAppProjectInfoXml.AppPool.Name, webAppProjectInfoXml.AppPool.Version, webAppProjectInfoXml.AppPool.Mode)); } var schedulerAppProjectInfoXml = projectInfoXml as SchedulerAppProjectInfoXml; if (schedulerAppProjectInfoXml != null) { return new SchedulerAppProjectInfo( schedulerAppProjectInfoXml.Name, schedulerAppProjectInfoXml.ArtifactsRepositoryName, schedulerAppProjectInfoXml.ArtifactsRepositoryDirName, schedulerAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, schedulerAppProjectInfoXml.SchedulerAppName, schedulerAppProjectInfoXml.SchedulerAppDirName, schedulerAppProjectInfoXml.SchedulerAppExeName, schedulerAppProjectInfoXml.SchedulerAppUserId, schedulerAppProjectInfoXml.ScheduledHour, schedulerAppProjectInfoXml.ScheduledMinute, schedulerAppProjectInfoXml.ExecutionTimeLimitInMinutes); } var terminalAppProjectInfoXml = projectInfoXml as TerminalAppProjectInfoXml; if (terminalAppProjectInfoXml != null) { return new TerminalAppProjectInfo( terminalAppProjectInfoXml.Name, terminalAppProjectInfoXml.ArtifactsRepositoryName, terminalAppProjectInfoXml.ArtifactsRepositoryDirName, terminalAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, terminalAppProjectInfoXml.TerminalAppName, terminalAppProjectInfoXml.TerminalAppDirName, terminalAppProjectInfoXml.TerminalAppExeName); } var dbProjectInfoXml = projectInfoXml as DbProjectInfoXml; if (dbProjectInfoXml != null) { return new DbProjectInfo( dbProjectInfoXml.Name, dbProjectInfoXml.ArtifactsRepositoryName, dbProjectInfoXml.ArtifactsRepositoryDirName, dbProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, dbProjectInfoXml.DbName); } throw new NotSupportedException(string.Format("Project type '{0}' is not supported.", projectInfoXml.GetType())); }
private static ProjectInfo CreateProjectInfo(ProjectInfoXml projectInfoXml) { List<string> allowedEnvironmentNames = (projectInfoXml.AllowedEnvironments ?? "") .Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries) .ToList(); var ntServiceProjectInfoXml = projectInfoXml as NtServiceProjectInfoXml; if (ntServiceProjectInfoXml != null) { return new NtServiceProjectInfo( ntServiceProjectInfoXml.Name, ntServiceProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, ntServiceProjectInfoXml.ArtifactsRepositoryDirName, ntServiceProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, ntServiceProjectInfoXml.NtServiceName, ntServiceProjectInfoXml.NtServiceDirName, ntServiceProjectInfoXml.NtServiceDisplayName, ntServiceProjectInfoXml.NtServiceExeName, ntServiceProjectInfoXml.NtServiceUserId); } var webAppProjectInfoXml = projectInfoXml as WebAppProjectInfoXml; if (webAppProjectInfoXml != null) { return new WebAppProjectInfo( webAppProjectInfoXml.Name, webAppProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, webAppProjectInfoXml.ArtifactsRepositoryDirName, webAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific); } var schedulerAppProjectInfoXml = projectInfoXml as SchedulerAppProjectInfoXml; if (schedulerAppProjectInfoXml != null) { return new SchedulerAppProjectInfo( schedulerAppProjectInfoXml.Name, schedulerAppProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, schedulerAppProjectInfoXml.ArtifactsRepositoryDirName, schedulerAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, schedulerAppProjectInfoXml.SchedulerAppDirName, schedulerAppProjectInfoXml.SchedulerAppExeName, schedulerAppProjectInfoXml.SchedulerAppTasks .Select( x => new SchedulerAppTask( x.Name, x.ExecutableName, x.UserId, x.ScheduledHour, x.ScheduledMinute, x.ExecutionTimeLimitInMinutes, x.Repetition.Enabled ? Repetition.CreateEnabled( TimeSpan.Parse(x.Repetition.Interval), TimeSpan.Parse(x.Repetition.Duration), x.Repetition.StopAtDurationEnd) : Repetition.CreatedDisabled()))); } var terminalAppProjectInfoXml = projectInfoXml as TerminalAppProjectInfoXml; if (terminalAppProjectInfoXml != null) { return new TerminalAppProjectInfo( terminalAppProjectInfoXml.Name, terminalAppProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, terminalAppProjectInfoXml.ArtifactsRepositoryDirName, terminalAppProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, terminalAppProjectInfoXml.TerminalAppName, terminalAppProjectInfoXml.TerminalAppDirName, terminalAppProjectInfoXml.TerminalAppExeName); } var dbProjectInfoXml = projectInfoXml as DbProjectInfoXml; if (dbProjectInfoXml != null) { return new DbProjectInfo( dbProjectInfoXml.Name, dbProjectInfoXml.ArtifactsRepositoryName, allowedEnvironmentNames, dbProjectInfoXml.ArtifactsRepositoryDirName, dbProjectInfoXml.ArtifactsAreNotEnvironmentSpecific, dbProjectInfoXml.DbName); } throw new NotSupportedException(string.Format("Project type '{0}' is not supported.", projectInfoXml.GetType())); }