-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Microsoft/develop
Merge develop into master to release new version
- Loading branch information
Showing
35 changed files
with
1,439 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ configuration: | |
|
||
environment: | ||
RunCodeAnalysis: true | ||
TreatWarningsAsErrors: true | ||
|
||
branches: | ||
only: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// <copyright file="Extensions.cs" company="Microsoft Corporation"> | ||
// Copyright (C) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt in the project root for license information. | ||
// </copyright> | ||
|
||
namespace Microsoft.VisualStudio.Setup | ||
{ | ||
using System; | ||
using System.Text; | ||
|
||
/// <summary> | ||
/// Extension methods. | ||
/// </summary> | ||
internal static class Extensions | ||
{ | ||
/// <summary> | ||
/// Returns a <see cref="Version"/> without negative fields. | ||
/// </summary> | ||
/// <param name="version">The <see cref="Version"/> to normalize.</param> | ||
/// <returns>A <see cref="Version"/> without negative fields.</returns> | ||
public static Version Normalize(this Version version) | ||
{ | ||
Validate.NotNull(version, nameof(version)); | ||
|
||
int build = version.Build > 0 ? version.Build : 0; | ||
int revision = version.Revision > 0 ? version.Revision : 0; | ||
|
||
return new Version(version.Major, version.Minor, build, revision); | ||
} | ||
|
||
/// <summary> | ||
/// Converts a string to PascalCase. | ||
/// </summary> | ||
/// <param name="value">The string value to convert.</param> | ||
/// <returns>If the string is not null or empty, a string converted to PascalCase; otherwise, the original string value.</returns> | ||
public static string ToPascalCase(this string value) | ||
{ | ||
if (!string.IsNullOrEmpty(value)) | ||
{ | ||
var sb = new StringBuilder(value); | ||
sb[0] = char.ToUpperInvariant(sb[0]); | ||
|
||
return sb.ToString(); | ||
} | ||
|
||
return value; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.