diff --git a/Bitbucket.Authentication/Authority.cs b/Bitbucket.Authentication/Authority.cs index 8f22f1c..8de1969 100644 --- a/Bitbucket.Authentication/Authority.cs +++ b/Bitbucket.Authentication/Authority.cs @@ -192,7 +192,7 @@ namespace Atlassian.Bitbucket.Authentication /// private static string GetEncodedCredentials(string user, string password) { - string authString = String.Format("{0}:{1}", user, password); + string authString = string.Format("{0}:{1}", user, password); byte[] authBytes = Encoding.UTF8.GetBytes(authString); string authEncode = Convert.ToBase64String(authBytes); return authEncode; diff --git a/Bitbucket.Authentication/BasicAuth/BasicAuthAuthenticator.cs b/Bitbucket.Authentication/BasicAuth/BasicAuthAuthenticator.cs index 7d0ce40..e27bf3b 100644 --- a/Bitbucket.Authentication/BasicAuth/BasicAuthAuthenticator.cs +++ b/Bitbucket.Authentication/BasicAuth/BasicAuthAuthenticator.cs @@ -19,7 +19,7 @@ namespace Atlassian.Bitbucket.Authentication.BasicAuth // use the provided username and password and attempt a Basic Auth request to a known // REST API resource. - string basicAuthValue = String.Format("{0}:{1}", username, password); + string basicAuthValue = string.Format("{0}:{1}", username, password); byte[] authBytes = Encoding.UTF8.GetBytes(basicAuthValue); basicAuthValue = Convert.ToBase64String(authBytes); var authHeader = "Basic " + basicAuthValue; diff --git a/Bitbucket.Authentication/TokenScope.cs b/Bitbucket.Authentication/TokenScope.cs index 7d85d44..b2772fc 100644 --- a/Bitbucket.Authentication/TokenScope.cs +++ b/Bitbucket.Authentication/TokenScope.cs @@ -36,7 +36,7 @@ namespace Atlassian.Bitbucket.Authentication /// public sealed class TokenScope: Microsoft.Alm.Authentication.TokenScope { - public static readonly TokenScope None = new TokenScope(String.Empty); + public static readonly TokenScope None = new TokenScope(string.Empty); /// /// Access accounts diff --git a/GitHub.Authentication/Authentication.cs b/GitHub.Authentication/Authentication.cs index a08d108..490405a 100644 --- a/GitHub.Authentication/Authentication.cs +++ b/GitHub.Authentication/Authentication.cs @@ -245,9 +245,9 @@ namespace GitHub.Authentication public async Task NoninteractiveLogonWithCredentials(TargetUri targetUri, string username, string password, string authenticationCode) { BaseSecureStore.ValidateTargetUri(targetUri); - if (String.IsNullOrWhiteSpace(username)) + if (string.IsNullOrWhiteSpace(username)) throw new ArgumentNullException("username", "The `username` parameter is null or invalid."); - if (String.IsNullOrWhiteSpace(password)) + if (string.IsNullOrWhiteSpace(password)) throw new ArgumentNullException("username", "The `password` parameter is null or invalid."); Credential credentials = null; diff --git a/GitHub.Authentication/Authority.cs b/GitHub.Authentication/Authority.cs index 0e5eff0..a32c6c1 100644 --- a/GitHub.Authentication/Authority.cs +++ b/GitHub.Authentication/Authority.cs @@ -86,13 +86,13 @@ namespace GitHub.Authentication httpClient.DefaultRequestHeaders.Add("User-Agent", Global.UserAgent); httpClient.DefaultRequestHeaders.Add("Accept", GitHubApiAcceptsHeaderValue); - string basicAuthValue = String.Format("{0}:{1}", username, password); + string basicAuthValue = string.Format("{0}:{1}", username, password); byte[] authBytes = Encoding.UTF8.GetBytes(basicAuthValue); basicAuthValue = Convert.ToBase64String(authBytes); httpClient.DefaultRequestHeaders.Add("Authorization", "Basic " + basicAuthValue); - if (!String.IsNullOrWhiteSpace(authenticationCode)) + if (!string.IsNullOrWhiteSpace(authenticationCode)) { httpClient.DefaultRequestHeaders.Add(GitHubOptHeader, authenticationCode); } @@ -119,7 +119,7 @@ namespace GitHub.Authentication scopesBuilder.Append(']'); - string jsonContent = String.Format(JsonContentFormat, scopesBuilder, targetUri, Environment.MachineName, DateTime.Now); + string jsonContent = string.Format(JsonContentFormat, scopesBuilder, targetUri, Environment.MachineName, DateTime.Now); using (StringContent content = new StringContent(jsonContent, Encoding.UTF8, HttpJsonContentType)) using (HttpResponseMessage response = await httpClient.PostAsync(_authorityUrl, content)) @@ -155,10 +155,10 @@ namespace GitHub.Authentication case HttpStatusCode.Unauthorized: { - if (String.IsNullOrWhiteSpace(authenticationCode) - && response.Headers.Any(x => String.Equals(GitHubOptHeader, x.Key, StringComparison.OrdinalIgnoreCase))) + if (string.IsNullOrWhiteSpace(authenticationCode) + && response.Headers.Any(x => string.Equals(GitHubOptHeader, x.Key, StringComparison.OrdinalIgnoreCase))) { - var mfakvp = response.Headers.First(x => String.Equals(GitHubOptHeader, x.Key, StringComparison.OrdinalIgnoreCase) && x.Value != null && x.Value.Count() > 0); + var mfakvp = response.Headers.First(x => string.Equals(GitHubOptHeader, x.Key, StringComparison.OrdinalIgnoreCase) && x.Value != null && x.Value.Count() > 0); if (mfakvp.Value.First().Contains("app")) { @@ -191,7 +191,7 @@ namespace GitHub.Authentication BaseSecureStore.ValidateTargetUri(targetUri); BaseSecureStore.ValidateCredential(credentials); - string authString = String.Format("{0}:{1}", credentials.Username, credentials.Password); + string authString = string.Format("{0}:{1}", credentials.Username, credentials.Password); byte[] authBytes = Encoding.UTF8.GetBytes(authString); string authEncode = Convert.ToBase64String(authBytes); diff --git a/GitHub.Authentication/Controls/Octicons/OcticonPath.cs b/GitHub.Authentication/Controls/Octicons/OcticonPath.cs index f0b5cd4..1aaf346 100644 --- a/GitHub.Authentication/Controls/Octicons/OcticonPath.cs +++ b/GitHub.Authentication/Controls/Octicons/OcticonPath.cs @@ -76,7 +76,7 @@ namespace GitHub.UI return g.Value; throw new ArgumentException( - String.Format(CultureInfo.InvariantCulture, "Unknown Octicon: {0}", icon), nameof(icon)); + string.Format(CultureInfo.InvariantCulture, "Unknown Octicon: {0}", icon), nameof(icon)); } // Initializes the cache dictionary with lazy entries for all available octicons diff --git a/GitHub.Authentication/Controls/TwoFactorInput.xaml.cs b/GitHub.Authentication/Controls/TwoFactorInput.xaml.cs index 5f48fde..5e54065 100644 --- a/GitHub.Authentication/Controls/TwoFactorInput.xaml.cs +++ b/GitHub.Authentication/Controls/TwoFactorInput.xaml.cs @@ -92,7 +92,7 @@ namespace GitHub.UI private void SetText(string text) { - if (String.IsNullOrEmpty(text)) + if (string.IsNullOrEmpty(text)) { foreach (var textBox in TextBoxes) { @@ -106,7 +106,7 @@ namespace GitHub.UI { TextBoxes[i].Text = digits[i].ToString(); } - SetValue(TextProperty, String.Join("", digits)); + SetValue(TextProperty, string.Join("", digits)); } public string Text @@ -175,7 +175,7 @@ namespace GitHub.UI textBox.TextChanged += (sender, args) => { - SetValue(TextProperty, String.Join("", GetTwoFactorCode())); + SetValue(TextProperty, string.Join("", GetTwoFactorCode())); var change = args.Changes.FirstOrDefault(); args.Handled = (change != null && change.AddedLength > 0) && MoveNext(); }; @@ -205,12 +205,12 @@ namespace GitHub.UI private static string GetTextBoxValue(TextBox textBox) { - return String.IsNullOrEmpty(textBox.Text) ? " " : textBox.Text; + return string.IsNullOrEmpty(textBox.Text) ? " " : textBox.Text; } private string GetTwoFactorCode() { - return String.Join("", TextBoxes.Select(textBox => textBox.Text)); + return string.Join("", TextBoxes.Select(textBox => textBox.Text)); } } } diff --git a/GitHub.Authentication/TokenScope.cs b/GitHub.Authentication/TokenScope.cs index dec4234..9c408b8 100644 --- a/GitHub.Authentication/TokenScope.cs +++ b/GitHub.Authentication/TokenScope.cs @@ -33,7 +33,7 @@ namespace GitHub.Authentication { public sealed class TokenScope: Microsoft.Alm.Authentication.TokenScope, IEquatable { - public static readonly TokenScope None = new TokenScope(String.Empty); + public static readonly TokenScope None = new TokenScope(string.Empty); /// /// Create gists diff --git a/Microsoft.Alm.Authentication/BaseSecureStore.cs b/Microsoft.Alm.Authentication/BaseSecureStore.cs index 9041d11..1de641e 100644 --- a/Microsoft.Alm.Authentication/BaseSecureStore.cs +++ b/Microsoft.Alm.Authentication/BaseSecureStore.cs @@ -126,8 +126,8 @@ namespace Microsoft.Alm.Authentication string password = passwordLength > 0 ? Marshal.PtrToStringUni(credStruct.CredentialBlob, passwordLength / sizeof(char)) - : String.Empty; - string username = credStruct.UserName ?? String.Empty; + : string.Empty; + string username = credStruct.UserName ?? string.Empty; credentials = new Credential(username, password); @@ -289,7 +289,7 @@ namespace Microsoft.Alm.Authentication { if (ReferenceEquals(token, null)) throw new ArgumentNullException(nameof(token)); - if (String.IsNullOrEmpty(token.Value)) + if (string.IsNullOrEmpty(token.Value)) throw new ArgumentException(nameof(token.Value)); } } diff --git a/Microsoft.Alm.Authentication/Credential.cs b/Microsoft.Alm.Authentication/Credential.cs index 9b69061..c231d20 100644 --- a/Microsoft.Alm.Authentication/Credential.cs +++ b/Microsoft.Alm.Authentication/Credential.cs @@ -32,7 +32,7 @@ namespace Microsoft.Alm.Authentication /// public sealed class Credential: Secret, IEquatable { - public static readonly Credential Empty = new Credential(String.Empty, String.Empty); + public static readonly Credential Empty = new Credential(string.Empty, string.Empty); /// /// Creates a credential object with a username and password pair. @@ -45,7 +45,7 @@ namespace Microsoft.Alm.Authentication throw new ArgumentNullException(nameof(username)); this.Username = username; - this.Password = password ?? String.Empty; + this.Password = password ?? string.Empty; } /// @@ -53,7 +53,7 @@ namespace Microsoft.Alm.Authentication /// /// The username value of the . public Credential(string username) - : this(username, String.Empty) + : this(username, string.Empty) { } /// @@ -111,8 +111,8 @@ namespace Microsoft.Alm.Authentication if (ReferenceEquals(credential1, null) || ReferenceEquals(null, credential2)) return false; - return String.Equals(credential1.Username, credential2.Username, StringComparison.Ordinal) - && String.Equals(credential1.Password, credential2.Password, StringComparison.Ordinal); + return string.Equals(credential1.Username, credential2.Username, StringComparison.Ordinal) + && string.Equals(credential1.Password, credential2.Password, StringComparison.Ordinal); } /// diff --git a/Microsoft.Alm.Authentication/SecretCache.cs b/Microsoft.Alm.Authentication/SecretCache.cs index e20ce7b..56823fa 100644 --- a/Microsoft.Alm.Authentication/SecretCache.cs +++ b/Microsoft.Alm.Authentication/SecretCache.cs @@ -37,7 +37,7 @@ namespace Microsoft.Alm.Authentication public SecretCache(string @namespace, Secret.UriNameConversion getTargetName) { - if (String.IsNullOrWhiteSpace(@namespace)) + if (string.IsNullOrWhiteSpace(@namespace)) throw new ArgumentNullException(@namespace); _namespace = @namespace; diff --git a/Microsoft.Alm.Authentication/Token.cs b/Microsoft.Alm.Authentication/Token.cs index 870f01f..4fd7b18 100644 --- a/Microsoft.Alm.Authentication/Token.cs +++ b/Microsoft.Alm.Authentication/Token.cs @@ -39,7 +39,7 @@ namespace Microsoft.Alm.Authentication public Token(string value, TokenType type) { - if (String.IsNullOrWhiteSpace(value)) + if (string.IsNullOrWhiteSpace(value)) throw new ArgumentNullException(nameof(value)); Debug.Assert(Enum.IsDefined(typeof(TokenType), type), $"The `{nameof(type)}` parameter is invalid"); @@ -50,9 +50,9 @@ namespace Microsoft.Alm.Authentication public Token(string value, string typeName) { - if (String.IsNullOrWhiteSpace(value)) + if (string.IsNullOrWhiteSpace(value)) throw new ArgumentNullException(nameof(value)); - if (String.IsNullOrWhiteSpace(typeName)) + if (string.IsNullOrWhiteSpace(typeName)) throw new ArgumentNullException(nameof(typeName)); TokenType type; @@ -126,7 +126,7 @@ namespace Microsoft.Alm.Authentication public static bool GetTypeFromFriendlyName(string name, out TokenType type) { - if (String.IsNullOrWhiteSpace(name)) + if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException(nameof(name)); type = TokenType.Unknown; @@ -138,7 +138,7 @@ namespace Microsoft.Alm.Authentication string typename; if (GetFriendlyNameFromType(type, out typename)) { - if (String.Equals(name, typename, StringComparison.OrdinalIgnoreCase)) + if (string.Equals(name, typename, StringComparison.OrdinalIgnoreCase)) return true; } } @@ -175,7 +175,7 @@ namespace Microsoft.Alm.Authentication { if (token == null) throw new ArgumentNullException(nameof(token)); - if (String.IsNullOrWhiteSpace(token.Value)) + if (string.IsNullOrWhiteSpace(token.Value)) throw new ArgumentException("Value property returned null or empty.", nameof(token)); if (token.Value.Length > NativeMethods.Credential.PasswordMaxLength) throw new ArgumentOutOfRangeException(nameof(token)); @@ -212,7 +212,7 @@ namespace Microsoft.Alm.Authentication { string value = Encoding.UTF8.GetString(bytes, preamble, bytes.Length - preamble); - if (!String.IsNullOrWhiteSpace(value)) + if (!string.IsNullOrWhiteSpace(value)) { token = new Token(value, type); token.TargetIdentity = targetIdentity; @@ -225,7 +225,7 @@ namespace Microsoft.Alm.Authentication { string value = Encoding.UTF8.GetString(bytes); - if (!String.IsNullOrWhiteSpace(value)) + if (!string.IsNullOrWhiteSpace(value)) { token = new Token(value, type); } @@ -243,7 +243,7 @@ namespace Microsoft.Alm.Authentication { if (ReferenceEquals(token, null)) throw new ArgumentNullException(nameof(token)); - if (String.IsNullOrWhiteSpace(token.Value)) + if (string.IsNullOrWhiteSpace(token.Value)) throw new ArgumentException("Value property returned null or empty.", nameof(token)); bytes = null; diff --git a/Microsoft.Alm.Authentication/TokenScope.cs b/Microsoft.Alm.Authentication/TokenScope.cs index 83d9bda..c036828 100644 --- a/Microsoft.Alm.Authentication/TokenScope.cs +++ b/Microsoft.Alm.Authentication/TokenScope.cs @@ -34,7 +34,7 @@ namespace Microsoft.Alm.Authentication { protected TokenScope(string value) { - if (String.IsNullOrWhiteSpace(value)) + if (string.IsNullOrWhiteSpace(value)) { _scopes = new string[0]; } @@ -63,7 +63,7 @@ namespace Microsoft.Alm.Authentication _scopes = result; } - public string Value { get { return String.Join(" ", _scopes); } } + public string Value { get { return string.Join(" ", _scopes); } } protected readonly IReadOnlyList _scopes; diff --git a/Microsoft.Alm.Authentication/WwwAuthenticateHelper.cs b/Microsoft.Alm.Authentication/WwwAuthenticateHelper.cs index 252b2ec..c08931b 100644 --- a/Microsoft.Alm.Authentication/WwwAuthenticateHelper.cs +++ b/Microsoft.Alm.Authentication/WwwAuthenticateHelper.cs @@ -34,7 +34,7 @@ namespace Microsoft.Alm.Authentication { internal class WwwAuthenticateHelper { - public static readonly Credential Credentials = new Credential(String.Empty, String.Empty); + public static readonly Credential Credentials = new Credential(string.Empty, string.Empty); public static readonly AuthenticationHeaderValue NtlmHeader = new AuthenticationHeaderValue("NTLM"); public static readonly AuthenticationHeaderValue NegotiateHeader = new AuthenticationHeaderValue("Negotiate"); diff --git a/Microsoft.Alm.Git/GitInstallation.cs b/Microsoft.Alm.Git/GitInstallation.cs index 84a7d99..1f60b31 100644 --- a/Microsoft.Alm.Git/GitInstallation.cs +++ b/Microsoft.Alm.Git/GitInstallation.cs @@ -106,7 +106,7 @@ namespace Microsoft.Alm.Git internal GitInstallation(string path, KnownGitDistribution version) { - Debug.Assert(!String.IsNullOrWhiteSpace(path), $"The `{nameof(path)}` parameter is null or invalid."); + Debug.Assert(!string.IsNullOrWhiteSpace(path), $"The `{nameof(path)}` parameter is null or invalid."); Debug.Assert(CommonConfigPaths.ContainsKey(version), $"The `{nameof(version)}` parameter not found in `{nameof(CommonConfigPaths)}`."); Debug.Assert(CommonCmdPaths.ContainsKey(version), $"The `{nameof(version)}` parameter not found in `{nameof(CommonCmdPaths)}`."); Debug.Assert(CommonGitPaths.ContainsKey(version), $"The `{nameof(version)}` parameter not found in `{nameof(CommonGitPaths)}`."); @@ -252,7 +252,7 @@ namespace Microsoft.Alm.Git return StringComparer.OrdinalIgnoreCase.GetHashCode(Path); } - public override String ToString() + public override string ToString() { return Path; } diff --git a/Microsoft.Alm.Git/Trace.cs b/Microsoft.Alm.Git/Trace.cs index f67b659..080586b 100644 --- a/Microsoft.Alm.Git/Trace.cs +++ b/Microsoft.Alm.Git/Trace.cs @@ -139,7 +139,7 @@ namespace Microsoft.Alm.Git const int SourceColumnMaxWidth = 23; // source column format is file:line - string source = String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}:{1}", filePath, lineNumber); + string source = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}:{1}", filePath, lineNumber); if (source.Length > SourceColumnMaxWidth) { @@ -163,7 +163,7 @@ namespace Microsoft.Alm.Git } // Git's trace format is "{timestamp,-15} {source,-23} trace: {details}" - string text = String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:HH:mm:ss.ffffff} {1,-23} trace: [{2}] {3}", DateTime.Now, source, memberName, message); + string text = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:HH:mm:ss.ffffff} {1,-23} trace: [{2}] {3}", DateTime.Now, source, memberName, message); return text; } diff --git a/Microsoft.Alm.Git/Where.cs b/Microsoft.Alm.Git/Where.cs index 4af87e5..054b2bf 100644 --- a/Microsoft.Alm.Git/Where.cs +++ b/Microsoft.Alm.Git/Where.cs @@ -44,7 +44,7 @@ namespace Microsoft.Alm.Git /// if succeeds; otherwise. static public bool FindApp(string name, out string path) { - if (!String.IsNullOrWhiteSpace(name)) + if (!string.IsNullOrWhiteSpace(name)) { string pathext = Environment.GetEnvironmentVariable("PATHEXT"); string envpath = Environment.GetEnvironmentVariable("PATH"); @@ -54,15 +54,15 @@ namespace Microsoft.Alm.Git for (int i = 0; i < paths.Length; i++) { - if (String.IsNullOrWhiteSpace(paths[i])) + if (string.IsNullOrWhiteSpace(paths[i])) continue; for (int j = 0; j < exts.Length; j++) { - if (String.IsNullOrWhiteSpace(exts[j])) + if (string.IsNullOrWhiteSpace(exts[j])) continue; - string value = String.Format("{0}\\{1}{2}", paths[i], name, exts[j]); + string value = string.Format("{0}\\{1}{2}", paths[i], name, exts[j]); if (File.Exists(value)) { value = value.Replace("\\\\", "\\"); @@ -100,24 +100,24 @@ namespace Microsoft.Alm.Git installations = null; - var programFiles32Path = String.Empty; - var programFiles64Path = String.Empty; - var appDataRoamingPath = String.Empty; - var appDataLocalPath = String.Empty; - var programDataPath = String.Empty; - var reg32HklmPath = String.Empty; - var reg64HklmPath = String.Empty; - var reg32HkcuPath = String.Empty; - var reg64HkcuPath = String.Empty; - var shellPathValue = String.Empty; + var programFiles32Path = string.Empty; + var programFiles64Path = string.Empty; + var appDataRoamingPath = string.Empty; + var appDataLocalPath = string.Empty; + var programDataPath = string.Empty; + var reg32HklmPath = string.Empty; + var reg64HklmPath = string.Empty; + var reg32HkcuPath = string.Empty; + var reg64HkcuPath = string.Empty; + var shellPathValue = string.Empty; using (var reg32HklmKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) using (var reg32HkcuKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32)) using (var reg32HklmSubKey = reg32HklmKey?.OpenSubKey(GitSubkeyName)) using (var reg32HkcuSubKey = reg32HkcuKey?.OpenSubKey(GitSubkeyName)) { - reg32HklmPath = reg32HklmSubKey?.GetValue(GitValueName, reg32HklmPath) as String; - reg32HkcuPath = reg32HkcuSubKey?.GetValue(GitValueName, reg32HkcuPath) as String; + reg32HklmPath = reg32HklmSubKey?.GetValue(GitValueName, reg32HklmPath) as string; + reg32HkcuPath = reg32HkcuSubKey?.GetValue(GitValueName, reg32HkcuPath) as string; } if ((programFiles32Path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)) != null) @@ -132,8 +132,8 @@ namespace Microsoft.Alm.Git using (var reg64HklmSubKey = reg64HklmKey?.OpenSubKey(GitSubkeyName)) using (var reg64HkcuSubKey = reg64HkcuKey?.OpenSubKey(GitSubkeyName)) { - reg64HklmPath = reg64HklmSubKey?.GetValue(GitValueName, reg64HklmPath) as String; - reg64HkcuPath = reg64HkcuSubKey?.GetValue(GitValueName, reg64HkcuPath) as String; + reg64HklmPath = reg64HklmSubKey?.GetValue(GitValueName, reg64HklmPath) as string; + reg64HkcuPath = reg64HkcuSubKey?.GetValue(GitValueName, reg64HkcuPath) as string; } if ((programFiles64Path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)) != null) @@ -172,46 +172,46 @@ namespace Microsoft.Alm.Git candidates.Add(new GitInstallation(shellPathValue, KnownGitDistribution.GitForWindows32v1)); } - if (!String.IsNullOrEmpty(reg64HklmPath)) + if (!string.IsNullOrEmpty(reg64HklmPath)) { candidates.Add(new GitInstallation(reg64HklmPath, KnownGitDistribution.GitForWindows64v2)); } - if (!String.IsNullOrEmpty(programFiles32Path)) + if (!string.IsNullOrEmpty(programFiles32Path)) { candidates.Add(new GitInstallation(programFiles64Path, KnownGitDistribution.GitForWindows64v2)); } - if (!String.IsNullOrEmpty(reg64HkcuPath)) + if (!string.IsNullOrEmpty(reg64HkcuPath)) { candidates.Add(new GitInstallation(reg64HkcuPath, KnownGitDistribution.GitForWindows64v2)); } - if (!String.IsNullOrEmpty(reg32HklmPath)) + if (!string.IsNullOrEmpty(reg32HklmPath)) { candidates.Add(new GitInstallation(reg32HklmPath, KnownGitDistribution.GitForWindows32v2)); candidates.Add(new GitInstallation(reg32HklmPath, KnownGitDistribution.GitForWindows32v1)); } - if (!String.IsNullOrEmpty(programFiles32Path)) + if (!string.IsNullOrEmpty(programFiles32Path)) { candidates.Add(new GitInstallation(programFiles32Path, KnownGitDistribution.GitForWindows32v2)); candidates.Add(new GitInstallation(programFiles32Path, KnownGitDistribution.GitForWindows32v1)); } - if (!String.IsNullOrEmpty(reg32HkcuPath)) + if (!string.IsNullOrEmpty(reg32HkcuPath)) { candidates.Add(new GitInstallation(reg32HkcuPath, KnownGitDistribution.GitForWindows32v2)); candidates.Add(new GitInstallation(reg32HkcuPath, KnownGitDistribution.GitForWindows32v1)); } - if (!String.IsNullOrEmpty(programDataPath)) + if (!string.IsNullOrEmpty(programDataPath)) { candidates.Add(new GitInstallation(programDataPath, KnownGitDistribution.GitForWindows64v2)); candidates.Add(new GitInstallation(programDataPath, KnownGitDistribution.GitForWindows32v2)); candidates.Add(new GitInstallation(programDataPath, KnownGitDistribution.GitForWindows32v1)); } - if (!String.IsNullOrEmpty(appDataLocalPath)) + if (!string.IsNullOrEmpty(appDataLocalPath)) { candidates.Add(new GitInstallation(appDataLocalPath, KnownGitDistribution.GitForWindows64v2)); candidates.Add(new GitInstallation(appDataLocalPath, KnownGitDistribution.GitForWindows32v2)); candidates.Add(new GitInstallation(appDataLocalPath, KnownGitDistribution.GitForWindows32v1)); } - if (!String.IsNullOrEmpty(appDataRoamingPath)) + if (!string.IsNullOrEmpty(appDataRoamingPath)) { candidates.Add(new GitInstallation(appDataRoamingPath, KnownGitDistribution.GitForWindows64v2)); candidates.Add(new GitInstallation(appDataRoamingPath, KnownGitDistribution.GitForWindows32v2)); @@ -311,7 +311,7 @@ namespace Microsoft.Alm.Git const string GitFolderName = ".git"; const string LocalConfigFileName = "config"; - if (!String.IsNullOrWhiteSpace(startingDirectory)) + if (!string.IsNullOrWhiteSpace(startingDirectory)) { var dir = new DirectoryInfo(startingDirectory); diff --git a/Microsoft.Vsts.Authentication/TokenRegistry.cs b/Microsoft.Vsts.Authentication/TokenRegistry.cs index fcc5c0b..60b00f8 100644 --- a/Microsoft.Vsts.Authentication/TokenRegistry.cs +++ b/Microsoft.Vsts.Authentication/TokenRegistry.cs @@ -90,7 +90,7 @@ namespace Microsoft.Alm.Authentication value = Encoding.UTF8.GetString(data); TokenType tokenType; - if (String.Equals(type, "Federated", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(type, "Federated", StringComparison.OrdinalIgnoreCase)) { tokenType = TokenType.Federated; } diff --git a/Microsoft.Vsts.Authentication/VstsTokenScope.cs b/Microsoft.Vsts.Authentication/VstsTokenScope.cs index d4a1771..8f79834 100644 --- a/Microsoft.Vsts.Authentication/VstsTokenScope.cs +++ b/Microsoft.Vsts.Authentication/VstsTokenScope.cs @@ -32,7 +32,7 @@ namespace Microsoft.Alm.Authentication { public class VstsTokenScope: TokenScope { - public static readonly VstsTokenScope None = new VstsTokenScope(String.Empty); + public static readonly VstsTokenScope None = new VstsTokenScope(string.Empty); /// /// Grants the ability to access build artifacts, including build results, definitions, and