private static string ReplaceToken(string propertyName, IMSBuildNuGetProjectSystem msBuildNuGetProjectSystem, bool throwIfNotFound)
 {
     var value = msBuildNuGetProjectSystem.GetPropertyValue(propertyName);
     if (value == null && throwIfNotFound)
     {
         throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Strings.TokenHasNoValue, propertyName));
     }
     return value;
 }
Example #2
0
        private static string ReplaceToken(string propertyName, IMSBuildNuGetProjectSystem msBuildNuGetProjectSystem, bool throwIfNotFound)
        {
            var value = msBuildNuGetProjectSystem.GetPropertyValue(propertyName);

            if (value == null && throwIfNotFound)
            {
                throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Strings.TokenHasNoValue, propertyName));
            }
            return(value);
        }
Example #3
0
 internal static string Process(Func <Stream> fileStreamFactory, IMSBuildNuGetProjectSystem msBuildNuGetProjectSystem)
 {
     return(NuGet.Common.Preprocessor.Process(fileStreamFactory, propName => msBuildNuGetProjectSystem.GetPropertyValue(propName)));
 }