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 @@ -448,12 +448,12 @@ internal string GetRemoveSessionObjectTarget(PSObject psObject)
instanceId = (Guid)psObject.Properties[instanceidPropName].Value;
}

if (psObject.Properties[namePropName].Value is String)
if (psObject.Properties[namePropName].Value is string)
{
name = (string)psObject.Properties[namePropName].Value;
}

if (psObject.Properties[computernamePropName].Value is String)
if (psObject.Properties[computernamePropName].Value is string)
{
computerName = (string)psObject.Properties[computernamePropName].Value;
}
Expand Down Expand Up @@ -637,7 +637,7 @@ internal IEnumerable<PSObject> QuerySession(IEnumerable<string> nameArray,
{
bool foundSession = false;
WildcardPattern pattern = new WildcardPattern(name, WildcardOptions.IgnoreCase);
foreach (KeyValuePair<String, HashSet<CimSessionWrapper>> kvp in this.curCimSessionsByName)
foreach (KeyValuePair<string, HashSet<CimSessionWrapper>> kvp in this.curCimSessionsByName)
{
if (pattern.IsMatch(kvp.Key))
{
Expand Down
26 changes: 13 additions & 13 deletions src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
List<string> logPatterns = new List<string>();
if (hash[hashkey_logname_lc] is Array)
{
foreach (Object elt in (Array)hash[hashkey_logname_lc])
foreach (object elt in (Array)hash[hashkey_logname_lc])
{
logPatterns.Add(elt.ToString());
}
Expand All @@ -1167,7 +1167,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
{
if (hash[hashkey_path_lc] is Array)
{
foreach (Object elt in (Array)hash[hashkey_path_lc])
foreach (object elt in (Array)hash[hashkey_path_lc])
{
StringCollection resolvedPaths = ValidateAndResolveFilePath(elt.ToString());
foreach (string resolvedPath in resolvedPaths)
Expand Down Expand Up @@ -1197,7 +1197,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
List<string> provPatterns = new List<string>();
if (hash[hashkey_providername_lc] is Array)
{
foreach (Object elt in (Array)hash[hashkey_providername_lc])
foreach (object elt in (Array)hash[hashkey_providername_lc])
{
provPatterns.Add(elt.ToString());
}
Expand Down Expand Up @@ -1347,7 +1347,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
// HandleEventIdHashValue helper for hashtable structured query builder.
// Constructs and returns EventId XPath portion as a string.
//
private string HandleEventIdHashValue(Object value)
private string HandleEventIdHashValue(object value)
{
StringBuilder ret = new StringBuilder();
Array idsArray = value as Array;
Expand Down Expand Up @@ -1377,7 +1377,7 @@ private string HandleEventIdHashValue(Object value)
// HandleLevelHashValue helper for hashtable structured query builder.
// Constructs and returns Level XPath portion as a string.
//
private string HandleLevelHashValue(Object value)
private string HandleLevelHashValue(object value)
{
StringBuilder ret = new StringBuilder();
Array levelsArray = value as Array;
Expand Down Expand Up @@ -1407,15 +1407,15 @@ private string HandleLevelHashValue(Object value)
// HandleKeywordHashValue helper for hashtable structured query builder.
// Constructs and returns Keyword XPath portion as a string.
//
private string HandleKeywordHashValue(Object value)
private string HandleKeywordHashValue(object value)
{
Int64 keywordsMask = 0;
Int64 keywordLong = 0;

Array keywordArray = value as Array;
if (keywordArray != null)
{
foreach (Object keyword in keywordArray)
foreach (object keyword in keywordArray)
{
if (KeywordStringToInt64(keyword.ToString(), ref keywordLong))
{
Expand All @@ -1442,7 +1442,7 @@ private string HandleKeywordHashValue(Object value)
// Handles both SIDs and domain account names.
// Writes an error and returns an empty string if the SID or account names are not valid.
//
private string HandleContextHashValue(Object value)
private string HandleContextHashValue(object value)
{
SecurityIdentifier sidCandidate = null;
try
Expand Down Expand Up @@ -1478,7 +1478,7 @@ private string HandleContextHashValue(Object value)
// Constructs and returns TimeCreated XPath portion as a string.
// NOTE that it also handles the hashtable "endtime" value (if supplied).
//
private string HandleStartTimeHashValue(Object value, Hashtable hash)
private string HandleStartTimeHashValue(object value, Hashtable hash)
{
StringBuilder ret = new StringBuilder();
DateTime startTime = new DateTime();
Expand Down Expand Up @@ -1521,7 +1521,7 @@ private string HandleStartTimeHashValue(Object value, Hashtable hash)
// Constructs and returns TimeCreated XPath portion as a string.
// NOTE that it also handles the hashtable "starttime" value (if supplied).
//
private string HandleEndTimeHashValue(Object value, Hashtable hash)
private string HandleEndTimeHashValue(object value, Hashtable hash)
{
StringBuilder ret = new StringBuilder();
DateTime endTime = new DateTime();
Expand Down Expand Up @@ -1565,7 +1565,7 @@ private string HandleEndTimeHashValue(Object value, Hashtable hash)
// HandleDataHashValue helper for hashtable structured query builder.
// Constructs and returns EventData/Data XPath portion as a string.
//
private string HandleDataHashValue(Object value)
private string HandleDataHashValue(object value)
{
StringBuilder ret = new StringBuilder();
Array dataArray = value as Array;
Expand Down Expand Up @@ -1596,7 +1596,7 @@ private string HandleDataHashValue(Object value)
// Constructs and returns named event data field XPath portion as a string.
// Fix Issue #2327
//
private string HandleNamedDataHashValue(String key, object value)
private string HandleNamedDataHashValue(string key, object value)
{
StringBuilder ret = new StringBuilder();
Array dataArray = value as Array;
Expand Down Expand Up @@ -1850,7 +1850,7 @@ private void CheckHashTablesForNullValues()
Array eltArray = value as Array;
if (eltArray != null)
{
foreach (Object elt in eltArray)
foreach (object elt in eltArray)
{
if (elt == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2597,7 +2597,7 @@ internal bool AssignProcessToJobObject(Process process)
/// Checks to see if the JobObject is empty (has no assigned processes).
/// If job is empty the auto reset event supplied as input would be set.
/// </summary>
internal void CheckJobStatus(Object stateInfo)
internal void CheckJobStatus(object stateInfo)
{
ManualResetEvent emptyJobAutoEvent = (ManualResetEvent)stateInfo;
int dwSize = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ internal NonscalarTypeHeader(OutGridViewCommand parentCmd, PSObject input) : bas
int index = 0;
foreach (string typeName in input.TypeNames)
{
if (index > 0 && (typeName.Equals(typeof(Object).FullName, StringComparison.OrdinalIgnoreCase) ||
if (index > 0 && (typeName.Equals(typeof(object).FullName, StringComparison.OrdinalIgnoreCase) ||
typeName.Equals(typeof(MarshalByRefObject).FullName, StringComparison.OrdinalIgnoreCase)))
{
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ internal static class HashAlgorithmNames
/// <summary>
/// Init a hash algorithm.
/// </summary>
protected void InitHasher(String Algorithm)
protected void InitHasher(string Algorithm)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Microsoft.PowerShell.Commands
/// <!-- author: LukaszA -->
[Cmdlet(VerbsCommon.Get, "Random", DefaultParameterSetName = GetRandomCommand.RandomNumberParameterSet,
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113446", RemotingCapability = RemotingCapability.None)]
[OutputType(typeof(Int32), typeof(Int64), typeof(Double))]
[OutputType(typeof(Int32), typeof(Int64), typeof(double))]
public class GetRandomCommand : PSCmdlet
{
#region Parameter set handling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private class ComCreateInfo

private ComCreateInfo createInfo;

private void STAComCreateThreadProc(Object createstruct)
private void STAComCreateThreadProc(object createstruct)
{
ComCreateInfo info = (ComCreateInfo)createstruct;
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ internal CultureInfo Culture
/// </summary>
/// <param name="inputObject">Input Object.</param>
/// <returns>True if both the objects are same or else returns false.</returns>
public override bool Equals(Object inputObject)
public override bool Equals(object inputObject)
{
ObjectCommandPropertyValue objectCommandPropertyValueObject = inputObject as ObjectCommandPropertyValue;
if (objectCommandPropertyValueObject == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ internal string GetShowAllModulesCommand()
return (string)_graphicalHostReflectionWrapper.CallStaticMethod("GetShowAllModulesCommand", false, true);
}

internal Dictionary<String, ShowCommandModuleInfo> GetImportedModulesDictionary(object[] moduleObjects)
internal Dictionary<string, ShowCommandModuleInfo> GetImportedModulesDictionary(object[] moduleObjects)
{
return (Dictionary<String, ShowCommandModuleInfo>)_graphicalHostReflectionWrapper.CallStaticMethod("GetImportedModulesDictionary", new object[] { moduleObjects });
return (Dictionary<string, ShowCommandModuleInfo>)_graphicalHostReflectionWrapper.CallStaticMethod("GetImportedModulesDictionary", new object[] { moduleObjects });
}

internal List<ShowCommandCommandInfo> GetCommandList(object[] commandObjects)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public int Timeout

private AutoResetEvent _eventArrived = new AutoResetEvent(false);
private PSEventArgs _receivedEvent = null;
private object _receivedEventLock = new Object();
private object _receivedEventLock = new object();
private WildcardPattern _matchPattern;

/// <summary>
Expand Down Expand Up @@ -112,7 +112,7 @@ protected override void StopProcessing()
_eventArrived.Set();
}

private void ReceivedEvents_PSEventReceived(Object sender, PSEventArgs e)
private void ReceivedEvents_PSEventReceived(object sender, PSEventArgs e)
{
// If they want to wait on just any event
if (_sourceIdentifier == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ internal virtual void FillRequestStream(HttpRequestMessage request)

// Add the content headers
if (request.Content == null)
{
{
request.Content = new StringContent(string.Empty);
request.Content.Headers.Clear();
}
Expand Down Expand Up @@ -1833,7 +1833,7 @@ internal void ParseLinkHeader(HttpResponseMessage response, System.Uri requestUr
}

/// <summary>
/// Adds content to a <see cref="MultipartFormDataContent" />. Object type detection is used to determine if the value is String, File, or Collection.
/// Adds content to a <see cref="MultipartFormDataContent" />. Object type detection is used to determine if the value is string, File, or Collection.
/// </summary>
/// <param name="fieldName">The Field Name to use.</param>
/// <param name="fieldValue">The Field Value to use.</param>
Expand Down Expand Up @@ -1889,11 +1889,11 @@ private void AddMultipartContent(object fieldName, object fieldValue, MultipartF
}

/// <summary>
/// Gets a <see cref="StringContent" /> from the supplied field name and field value. Uses <see cref="ConvertTo<T>(Object)" /> to convert the objects to strings.
/// Gets a <see cref="StringContent" /> from the supplied field name and field value. Uses <see cref="ConvertTo<T>(object)" /> to convert the objects to strings.
/// </summary>
/// <param name="fieldName">The Field Name to use for the <see cref="StringContent" /></param>
/// <param name="fieldValue">The Field Value to use for the <see cref="StringContent" /></param>
private StringContent GetMultipartStringContent(Object fieldName, object fieldValue)
private StringContent GetMultipartStringContent(object fieldName, object fieldValue)
{
var contentDisposition = new ContentDispositionHeaderValue("form-data");
// .NET does not enclose field names in quotes, however, modern browsers and curl do.
Expand All @@ -1906,11 +1906,11 @@ private StringContent GetMultipartStringContent(Object fieldName, object fieldVa
}

/// <summary>
/// Gets a <see cref="StreamContent" /> from the supplied field name and <see cref="Stream" />. Uses <see cref="ConvertTo<T>(Object)" /> to convert the fieldname to a string.
/// Gets a <see cref="StreamContent" /> from the supplied field name and <see cref="Stream" />. Uses <see cref="ConvertTo<T>(object)" /> to convert the fieldname to a string.
/// </summary>
/// <param name="fieldName">The Field Name to use for the <see cref="StreamContent" /></param>
/// <param name="stream">The <see cref="Stream" /> to use for the <see cref="StreamContent" /></param>
private StreamContent GetMultipartStreamContent(Object fieldName, Stream stream)
private StreamContent GetMultipartStreamContent(object fieldName, Stream stream)
{
var contentDisposition = new ContentDispositionHeaderValue("form-data");
// .NET does not enclose field names in quotes, however, modern browsers and curl do.
Expand All @@ -1924,11 +1924,11 @@ private StreamContent GetMultipartStreamContent(Object fieldName, Stream stream)
}

/// <summary>
/// Gets a <see cref="StreamContent" /> from the supplied field name and file. Calls <see cref="GetMultipartStreamContent(Object, Stream)" /> to create the <see cref="StreamContent" /> and then sets the file name.
/// Gets a <see cref="StreamContent" /> from the supplied field name and file. Calls <see cref="GetMultipartStreamContent(object, Stream)" /> to create the <see cref="StreamContent" /> and then sets the file name.
/// </summary>
/// <param name="fieldName">The Field Name to use for the <see cref="StreamContent" /></param>
/// <param name="file">The file to use for the <see cref="StreamContent" /></param>
private StreamContent GetMultipartFileContent(Object fieldName, FileInfo file)
private StreamContent GetMultipartFileContent(object fieldName, FileInfo file)
{
var result = GetMultipartStreamContent(fieldName: fieldName, stream: new FileStream(file.FullName, FileMode.Open));
// .NET does not enclose field names in quotes, however, modern browsers and curl do.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ private static object ProcessValue(object obj, int currentDepth, in ConvertToJso
}
else
{
rv = LanguagePrimitives.ConvertTo(obj, typeof(String),
rv = LanguagePrimitives.ConvertTo(obj, typeof(string),
CultureInfo.InvariantCulture);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ internal static string DecodeStream(Stream stream, ref Encoding encoding)
return content;
}

internal static byte[] EncodeToBytes(String str, Encoding encoding)
internal static byte[] EncodeToBytes(string str, Encoding encoding)
{
if (encoding == null)
{
Expand All @@ -469,7 +469,7 @@ internal static byte[] EncodeToBytes(String str, Encoding encoding)
return encoding.GetBytes(str);
}

internal static byte[] EncodeToBytes(String str)
internal static byte[] EncodeToBytes(string str)
{
return EncodeToBytes(str, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ internal Collection<PSTraceSource> GetMatchingTraceSource(
patternToMatch,
WildcardOptions.IgnoreCase);

Dictionary<String, PSTraceSource> traceCatalog = PSTraceSource.TraceCatalog;
Dictionary<string, PSTraceSource> traceCatalog = PSTraceSource.TraceCatalog;

foreach (PSTraceSource source in traceCatalog.Values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public override
// assigned to an array

// if the field is an array, the element type can be found; else, use Object
Type elementType = typeof(Object);
Type elementType = typeof(object);
if (fieldType.IsArray)
{
elementType = fieldType.GetElementType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ private static string EngineVersion
}
}

private Dictionary<String, object> _regValues = null;
private Dictionary<string, object> _regValues = null;
/// <summary>
/// </summary>
internal sealed override Dictionary<String, object> RegValues
internal sealed override Dictionary<string, object> RegValues
{
get
{
if (_regValues == null)
{
_regValues = new Dictionary<String, object>();
_regValues = new Dictionary<string, object>();
_regValues[RegistryStrings.MonadEngine_MonadVersion] = EngineVersion;
_regValues[RegistryStrings.MonadEngine_ApplicationBase] = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
_regValues[RegistryStrings.MonadEngine_ConsoleHostAssemblyName] = Assembly.GetExecutingAssembly().FullName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,6 @@ to fill the passed in ETW data descriptor.
*decimalptr = (decimal)data;
dataDescriptor->DataPointer = (ulong)decimalptr;
}
else if (data is Boolean)
Comment thread
TravisEz13 marked this conversation as resolved.
Resolved
{
dataDescriptor->Size = (uint)sizeof(bool);
Boolean* booleanptr = (Boolean*)dataBuffer;
*booleanptr = (bool)data;
dataDescriptor->DataPointer = (ulong)booleanptr;
}
else
{
// To our eyes, everything else is a just a string
Expand Down
Loading