private static string GetNewErrorCondition(string oldCondition, IEnumerable <IVsPackageMetadata> packages, string slnDir, string projectDirPath, ModifyPackagePathDelegate modifyPackagePath, MsBuild.Project project) { return(Regex.Replace (oldCondition , @"(?<=^!Exists\(').*(?='\)$)" , m => modifyPackagePath(MsBuildHelper.Evaluate(m.Value, project), m.Value, packages, slnDir, projectDirPath) ?? m.Value )); }
private static string GetNewErrorText(string oldText, IEnumerable <IVsPackageMetadata> packages, string slnDir, string projectDirPath, ModifyPackagePathDelegate modifyPackagePath, MsBuild.Project project) { return(Regex.Replace (oldText , @"(?<=^\$\(\[System\.String\]::Format\('\$\(ErrorText\)', ').*(?='\)\)$)" , m => modifyPackagePath(MsBuildHelper.Evaluate(m.Value, project), m.Value, packages, slnDir, projectDirPath) ?? m.Value )); }