Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ internal CimCmdletAliasEntry(string name, string value)
/// </summary>
internal string Value { get { return this._value; } }

private string _value = String.Empty;
private string _value = string.Empty;

/// <summary>
/// The string defining real cmdlet name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ internal void ThrowInvalidAuthenticationTypeError(
string parameterName,
PasswordAuthenticationMechanism authentication)
{
string message = String.Format(CultureInfo.CurrentUICulture, Strings.InvalidAuthenticationTypeWithNullCredential,
string message = string.Format(CultureInfo.CurrentUICulture, Strings.InvalidAuthenticationTypeWithNullCredential,
authentication,
ImpersonatedAuthenticationMechanism.None,
ImpersonatedAuthenticationMechanism.Negotiate,
Expand All @@ -925,7 +925,7 @@ internal void ThrowConflictParameterWasSet(
string parameterName,
string conflictParameterName)
{
string message = String.Format(CultureInfo.CurrentUICulture,
string message = string.Format(CultureInfo.CurrentUICulture,
Strings.ConflictParameterWasSet,
parameterName, conflictParameterName);
PSArgumentException exception = new PSArgumentException(message, parameterName);
Expand Down Expand Up @@ -955,7 +955,7 @@ internal void ThrowInvalidProperty(
propList.Append(property);
}

string message = String.Format(CultureInfo.CurrentUICulture, Strings.CouldNotFindPropertyFromGivenClass,
string message = string.Format(CultureInfo.CurrentUICulture, Strings.CouldNotFindPropertyFromGivenClass,
className, propList);
PSArgumentOutOfRangeException exception = new PSArgumentOutOfRangeException(
parameterName, actualValue, message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ protected static String CreateQuery(CimBaseCommand cmdlet)
}

return (cmd.Filter == null) ?
String.Format(CultureInfo.CurrentUICulture, queryWithoutWhere, propertyList, cmd.ClassName) :
String.Format(CultureInfo.CurrentUICulture, queryWithWhere, propertyList, cmd.ClassName, cmd.Filter);
string.Format(CultureInfo.CurrentUICulture, queryWithoutWhere, propertyList, cmd.ClassName) :
string.Format(CultureInfo.CurrentUICulture, queryWithWhere, propertyList, cmd.ClassName, cmd.Filter);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ private CimMethodParametersCollection CreateParametersCollection(
declaration = cimClass.CimClassMethods[methodName];
if (declaration == null)
{
throw new ArgumentException(String.Format(
throw new ArgumentException(string.Format(
CultureInfo.CurrentUICulture, Strings.InvalidMethod, methodName, className));
}
}
Expand All @@ -406,7 +406,7 @@ private CimMethodParametersCollection CreateParametersCollection(
CimMethodParameterDeclaration paramDeclaration = declaration.Parameters[parameterName];
if (paramDeclaration == null)
{
throw new ArgumentException(String.Format(
throw new ArgumentException(string.Format(
CultureInfo.CurrentUICulture, Strings.InvalidMethodParameter, parameterName, methodName, className));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void RegisterCimIndication(
DebugHelper.WriteLogEx("queryDialect = '{0}'; queryExpression = '{1}'", 0, queryDialect, queryExpression);
if (cimSession == null)
{
throw new ArgumentNullException(String.Format(CultureInfo.CurrentUICulture, Strings.NullArgument, @"cimSession"));
throw new ArgumentNullException(string.Format(CultureInfo.CurrentUICulture, Strings.NullArgument, @"cimSession"));
}

this.TargetComputerName = cimSession.ComputerName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public override void OnNext(CimMethodResultBase value)
{
resultObject.Properties.Add(new PSNoteProperty(@"PSComputerName", this.CurrentSession.ComputerName));
resultObject.TypeNames.Insert(0, resultObjectPSType);
resultObject.TypeNames.Insert(0, String.Format(CultureInfo.InvariantCulture, PSTypeCimMethodResultTemplate, resultObjectPSType, ClassName, MethodName));
resultObject.TypeNames.Insert(0, string.Format(CultureInfo.InvariantCulture, PSTypeCimMethodResultTemplate, resultObjectPSType, ClassName, MethodName));
base.OnNextCore(resultObject);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,12 @@ internal PSObject AddObjectToCache(
/// <param name="psObject"></param>
internal string GetRemoveSessionObjectTarget(PSObject psObject)
{
String message = String.Empty;
String message = string.Empty;
if (psObject.BaseObject is CimSession)
{
UInt32 id = 0x0;
Guid instanceId = Guid.Empty;
String name = String.Empty;
String name = string.Empty;
String computerName = string.Empty;
if (psObject.Properties[idPropName].Value is UInt32)
{
Expand All @@ -458,7 +458,7 @@ internal string GetRemoveSessionObjectTarget(PSObject psObject)
computerName = (String)psObject.Properties[computernamePropName].Value;
}

message = String.Format(CultureInfo.CurrentUICulture, SessionObjectPath, id, instanceId, name, computerName);
message = string.Format(CultureInfo.CurrentUICulture, SessionObjectPath, id, instanceId, name, computerName);
}

return message;
Expand Down Expand Up @@ -551,7 +551,7 @@ private void AddErrorRecord(
{
errRecords.Add(
new ErrorRecord(
new CimException(String.Format(CultureInfo.CurrentUICulture, Strings.CouldNotFindCimsessionObject, propertyName, propertyValue)),
new CimException(string.Format(CultureInfo.CurrentUICulture, Strings.CouldNotFindCimsessionObject, propertyName, propertyValue)),
string.Empty,
ErrorCategory.ObjectNotFound,
null));
Expand Down Expand Up @@ -870,7 +870,7 @@ private static void DefaultRunspace_StateChanged(object sender, RunspaceStateEve
CimSessionState state;
if (cimSessions.TryRemove(runspace.InstanceId, out state))
{
DebugHelper.WriteLog(String.Format(CultureInfo.CurrentUICulture, DebugHelper.runspaceStateChanged, runspace.InstanceId, e.RunspaceStateInfo.State));
DebugHelper.WriteLog(string.Format(CultureInfo.CurrentUICulture, DebugHelper.runspaceStateChanged, runspace.InstanceId, e.RunspaceStateInfo.State));
state.Dispose();
}

Expand Down Expand Up @@ -1001,7 +1001,7 @@ internal void AddSessionToCache(CimSession cimSession, XOperationContextBase con
CimTestCimSessionContext testCimSessionContext = context as CimTestCimSessionContext;
UInt32 sessionId = this.sessionState.GenerateSessionId();
string originalSessionName = testCimSessionContext.CimSessionWrapper.Name;
string sessionName = (originalSessionName != null) ? originalSessionName : String.Format(CultureInfo.CurrentUICulture, @"{0}{1}", CimSessionState.CimSessionClassName, sessionId);
string sessionName = (originalSessionName != null) ? originalSessionName : string.Format(CultureInfo.CurrentUICulture, @"{0}{1}", CimSessionState.CimSessionClassName, sessionId);

// detach CimSession from the proxy object
CimSession createdCimSession = testCimSessionContext.Proxy.Detach();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ public void EnumerateInstancesAsync(string namespaceName, string className)
this.operationParameters.Add(@"className", className);
this.WriteOperationStartMessage(this.operationName, this.operationParameters);
CimAsyncMultipleResults<CimInstance> asyncResult = this.session.EnumerateInstancesAsync(namespaceName, className, this.options);
string errorSource = String.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
string errorSource = string.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
ConsumeCimInstanceAsync(asyncResult, new CimResultContext(errorSource));
}

Expand Down Expand Up @@ -1305,7 +1305,7 @@ public void EnumerateClassesAsync(string namespaceName, string className)
this.operationParameters.Add(@"className", className);
this.WriteOperationStartMessage(this.operationName, this.operationParameters);
CimAsyncMultipleResults<CimClass> asyncResult = this.session.EnumerateClassesAsync(namespaceName, className, this.options);
string errorSource = String.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
string errorSource = string.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
ConsumeCimClassAsync(asyncResult, new CimResultContext(errorSource));
}

Expand All @@ -1325,7 +1325,7 @@ public void GetClassAsync(string namespaceName, string className)
this.operationParameters.Add(@"className", className);
this.WriteOperationStartMessage(this.operationName, this.operationParameters);
CimAsyncResult<CimClass> asyncResult = this.session.GetClassAsync(namespaceName, className, this.options);
string errorSource = String.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
string errorSource = string.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
ConsumeCimClassAsync(asyncResult, new CimResultContext(errorSource));
}

Expand Down Expand Up @@ -1379,7 +1379,7 @@ public void InvokeMethodAsync(
this.operationParameters.Add(@"methodName", methodName);
this.WriteOperationStartMessage(this.operationName, this.operationParameters);
CimAsyncMultipleResults<CimMethodResultBase> asyncResult = this.session.InvokeMethodAsync(namespaceName, className, methodName, methodParameters, this.options);
string errorSource = String.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
string errorSource = string.Format(CultureInfo.CurrentUICulture, "{0}:{1}", namespaceName, className);
ConsumeCimInvokeMethodResultAsync(asyncResult, className, methodName, new CimResultContext(errorSource));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private bool SetProperty(IDictionary properties, ref CimInstance cimInstance, re
if ((property.Flags & CimFlags.ReadOnly) == CimFlags.ReadOnly)
{
// can not modify ReadOnly property
exception = new CimException(String.Format(CultureInfo.CurrentUICulture,
exception = new CimException(string.Format(CultureInfo.CurrentUICulture,
Strings.CouldNotModifyReadonlyProperty, key, cimInstance));
return false;
}
Expand Down Expand Up @@ -280,7 +280,7 @@ private bool SetProperty(IDictionary properties, ref CimInstance cimInstance, re
{
if (e.NativeErrorCode == NativeErrorCode.Failed)
{
string errorMessage = String.Format(CultureInfo.CurrentUICulture,
string errorMessage = string.Format(CultureInfo.CurrentUICulture,
Strings.UnableToAddPropertyToInstance,
newProperty.Name,
cimInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ public override void WriteObject(object sendToPipeline, XOperationContextBase co
CimSetCimInstanceContext setContext = context as CimSetCimInstanceContext;
if (setContext != null)
{
if ((String.Compare(setContext.ParameterSetName, CimBaseCommand.QueryComputerSet, StringComparison.OrdinalIgnoreCase) == 0) ||
(String.Compare(setContext.ParameterSetName, CimBaseCommand.QuerySessionSet, StringComparison.OrdinalIgnoreCase) == 0))
if ((string.Compare(setContext.ParameterSetName, CimBaseCommand.QueryComputerSet, StringComparison.OrdinalIgnoreCase) == 0) ||
(string.Compare(setContext.ParameterSetName, CimBaseCommand.QuerySessionSet, StringComparison.OrdinalIgnoreCase) == 0))
{
this.setCimInstance.SetCimInstance(sendToPipeline as CimInstance, setContext, this);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ internal WSManSessionOptions CreateWSMANSessionOptions()
wsmanoptions.MaxEnvelopeSize = 0;
}

if (!String.IsNullOrWhiteSpace(this.ProxyCertificateThumbprint))
if (!string.IsNullOrWhiteSpace(this.ProxyCertificateThumbprint))
{
CimCredential credentials = new CimCredential(CertificateAuthenticationMechanism.Default, this.ProxyCertificateThumbprint);
wsmanoptions.AddProxyCredentials(credentials);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected override object GetSourceObject()
case CimBaseCommand.ClassNameComputerSet:
// validate the classname
this.CheckArgument();
tempQueryExpression = String.Format(CultureInfo.CurrentCulture, "Select * from {0}", this.ClassName);
tempQueryExpression = string.Format(CultureInfo.CurrentCulture, "Select * from {0}", this.ClassName);
break;
}

Expand Down
12 changes: 6 additions & 6 deletions src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ internal static void WriteEmptyLine()
/// <param name="message"></param>
internal static void WriteLog(string message, int indent, params object[] args)
{
String outMessage = String.Empty;
String outMessage = string.Empty;
FormatLogMessage(ref outMessage, message, args);
WriteLog(outMessage, indent);
}
Expand All @@ -276,7 +276,7 @@ internal static void WriteLog(string message, int indent)
/// <param name="message"></param>
internal static void WriteLogEx(string message, int indent, params object[] args)
{
String outMessage = String.Empty;
String outMessage = string.Empty;
WriteLogInternal(string.Empty, 0, -1);
FormatLogMessage(ref outMessage, message, args);
WriteLogInternal(outMessage, indent, 3);
Expand Down Expand Up @@ -313,7 +313,7 @@ internal static void WriteLogEx()
[Conditional("LOGENABLE")]
private static void FormatLogMessage(ref String outMessage, string message, params object[] args)
{
outMessage = String.Format(CultureInfo.CurrentCulture, message, args);
outMessage = string.Format(CultureInfo.CurrentCulture, message, args);
}

/// <summary>
Expand Down Expand Up @@ -402,7 +402,7 @@ public static void ValidateNoNullArgument(object obj, string argumentName)
/// <param name="argumentName"></param>
public static void ValidateNoNullorWhiteSpaceArgument(string obj, string argumentName)
{
if (String.IsNullOrWhiteSpace(obj))
if (string.IsNullOrWhiteSpace(obj))
{
throw new ArgumentException(argumentName);
}
Expand Down Expand Up @@ -433,7 +433,7 @@ public static string ValidateArgumentIsValidName(string parameterName, string va
}

DebugHelper.WriteLogEx("An invalid name: {0}={1}", 0, parameterName, value);
throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, Strings.InvalidParameterValue, value, parameterName));
throw new ArgumentException(string.Format(CultureInfo.CurrentUICulture, Strings.InvalidParameterValue, value, parameterName));
}

/// <summary>
Expand All @@ -451,7 +451,7 @@ public static String[] ValidateArgumentIsValidName(string parameterName, String[
foreach (string propertyName in value)
{
// * is wild char supported in select properties
if ((propertyName != null) && (String.Compare(propertyName.Trim(), "*", StringComparison.OrdinalIgnoreCase) == 0))
if ((propertyName != null) && (string.Compare(propertyName.Trim(), "*", StringComparison.OrdinalIgnoreCase) == 0))
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static uint FormatMessageFromModule(uint lastError, string moduleName, ou
Debug.Assert(!string.IsNullOrEmpty(moduleName));

uint formatError = 0;
msg = String.Empty;
msg = string.Empty;
IntPtr moduleHandle = IntPtr.Zero;

moduleHandle = LoadLibraryEx(moduleName, IntPtr.Zero, LOAD_LIBRARY_AS_DATAFILE);
Expand Down
Loading