public SolutionConfigurationFile Create(string filePath) { var solutionProjectReferences = _solutionProjectReferencesFactory.CreateFromSolutionFile(filePath); var result = new SolutionConfigurationFile(filePath, solutionProjectReferences); return(result); }
private void SaveSolutionToFile(SolutionConfigurationFile solutionConfigFile) { var solutionConfigData = _solutionConfigDataFactory.CreateSolutionConfigurationData(solutionConfigFile); _informationPublishingService.Publish(InformationType.Info, $"Saving Solution to {solutionConfigFile.FilePath}..."); _fileProxy.WriteAllText(solutionConfigFile.FilePath, solutionConfigData); }
public SolutionSwitchResult( SolutionConfigurationFile switchedSolutionConfigFile, IReadOnlyCollection <ProjectConfigurationFile> switchedProjectConfigFiles) { Guard.ObjectNotNull(() => switchedSolutionConfigFile); Guard.ObjectNotNull(() => switchedProjectConfigFiles); SwitchedSolutionConfigFile = switchedSolutionConfigFile; SwitchedProjectConfigFiles = switchedProjectConfigFiles; }
public string CreateSolutionConfigData(string solutionPath, SolutionConfigurationFile solutionConfig) { var solutionConfigData = _fileProxy.ReadAllText(solutionPath); _solutionProjectBlockHandler.Initialize(solutionPath); var allBlocksInFile = _solutionProjectBlockHandler.GetAllBlocks(); foreach (var blockInFile in allBlocksInFile) { if (!solutionConfig.CheckIfContainsReference(blockInFile.AssemblyName)) { solutionConfigData = solutionConfigData.Replace(blockInFile.Data, string.Empty); } } return(solutionConfigData); }