Skip to content

Commit d58a82a

Browse files
authored
Cleanup: use the built-in type alias (#10882)
1 parent 6aa3188 commit d58a82a

File tree

91 files changed

+389
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+389
-396
lines changed

src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,12 @@ internal string GetRemoveSessionObjectTarget(PSObject psObject)
448448
instanceId = (Guid)psObject.Properties[instanceidPropName].Value;
449449
}
450450

451-
if (psObject.Properties[namePropName].Value is String)
451+
if (psObject.Properties[namePropName].Value is string)
452452
{
453453
name = (string)psObject.Properties[namePropName].Value;
454454
}
455455

456-
if (psObject.Properties[computernamePropName].Value is String)
456+
if (psObject.Properties[computernamePropName].Value is string)
457457
{
458458
computerName = (string)psObject.Properties[computernamePropName].Value;
459459
}
@@ -637,7 +637,7 @@ internal IEnumerable<PSObject> QuerySession(IEnumerable<string> nameArray,
637637
{
638638
bool foundSession = false;
639639
WildcardPattern pattern = new WildcardPattern(name, WildcardOptions.IgnoreCase);
640-
foreach (KeyValuePair<String, HashSet<CimSessionWrapper>> kvp in this.curCimSessionsByName)
640+
foreach (KeyValuePair<string, HashSet<CimSessionWrapper>> kvp in this.curCimSessionsByName)
641641
{
642642
if (pattern.IsMatch(kvp.Key))
643643
{

src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
11421142
List<string> logPatterns = new List<string>();
11431143
if (hash[hashkey_logname_lc] is Array)
11441144
{
1145-
foreach (Object elt in (Array)hash[hashkey_logname_lc])
1145+
foreach (object elt in (Array)hash[hashkey_logname_lc])
11461146
{
11471147
logPatterns.Add(elt.ToString());
11481148
}
@@ -1167,7 +1167,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
11671167
{
11681168
if (hash[hashkey_path_lc] is Array)
11691169
{
1170-
foreach (Object elt in (Array)hash[hashkey_path_lc])
1170+
foreach (object elt in (Array)hash[hashkey_path_lc])
11711171
{
11721172
StringCollection resolvedPaths = ValidateAndResolveFilePath(elt.ToString());
11731173
foreach (string resolvedPath in resolvedPaths)
@@ -1197,7 +1197,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
11971197
List<string> provPatterns = new List<string>();
11981198
if (hash[hashkey_providername_lc] is Array)
11991199
{
1200-
foreach (Object elt in (Array)hash[hashkey_providername_lc])
1200+
foreach (object elt in (Array)hash[hashkey_providername_lc])
12011201
{
12021202
provPatterns.Add(elt.ToString());
12031203
}
@@ -1347,7 +1347,7 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession
13471347
// HandleEventIdHashValue helper for hashtable structured query builder.
13481348
// Constructs and returns EventId XPath portion as a string.
13491349
//
1350-
private string HandleEventIdHashValue(Object value)
1350+
private string HandleEventIdHashValue(object value)
13511351
{
13521352
StringBuilder ret = new StringBuilder();
13531353
Array idsArray = value as Array;
@@ -1377,7 +1377,7 @@ private string HandleEventIdHashValue(Object value)
13771377
// HandleLevelHashValue helper for hashtable structured query builder.
13781378
// Constructs and returns Level XPath portion as a string.
13791379
//
1380-
private string HandleLevelHashValue(Object value)
1380+
private string HandleLevelHashValue(object value)
13811381
{
13821382
StringBuilder ret = new StringBuilder();
13831383
Array levelsArray = value as Array;
@@ -1407,15 +1407,15 @@ private string HandleLevelHashValue(Object value)
14071407
// HandleKeywordHashValue helper for hashtable structured query builder.
14081408
// Constructs and returns Keyword XPath portion as a string.
14091409
//
1410-
private string HandleKeywordHashValue(Object value)
1410+
private string HandleKeywordHashValue(object value)
14111411
{
14121412
Int64 keywordsMask = 0;
14131413
Int64 keywordLong = 0;
14141414

14151415
Array keywordArray = value as Array;
14161416
if (keywordArray != null)
14171417
{
1418-
foreach (Object keyword in keywordArray)
1418+
foreach (object keyword in keywordArray)
14191419
{
14201420
if (KeywordStringToInt64(keyword.ToString(), ref keywordLong))
14211421
{
@@ -1442,7 +1442,7 @@ private string HandleKeywordHashValue(Object value)
14421442
// Handles both SIDs and domain account names.
14431443
// Writes an error and returns an empty string if the SID or account names are not valid.
14441444
//
1445-
private string HandleContextHashValue(Object value)
1445+
private string HandleContextHashValue(object value)
14461446
{
14471447
SecurityIdentifier sidCandidate = null;
14481448
try
@@ -1478,7 +1478,7 @@ private string HandleContextHashValue(Object value)
14781478
// Constructs and returns TimeCreated XPath portion as a string.
14791479
// NOTE that it also handles the hashtable "endtime" value (if supplied).
14801480
//
1481-
private string HandleStartTimeHashValue(Object value, Hashtable hash)
1481+
private string HandleStartTimeHashValue(object value, Hashtable hash)
14821482
{
14831483
StringBuilder ret = new StringBuilder();
14841484
DateTime startTime = new DateTime();
@@ -1521,7 +1521,7 @@ private string HandleStartTimeHashValue(Object value, Hashtable hash)
15211521
// Constructs and returns TimeCreated XPath portion as a string.
15221522
// NOTE that it also handles the hashtable "starttime" value (if supplied).
15231523
//
1524-
private string HandleEndTimeHashValue(Object value, Hashtable hash)
1524+
private string HandleEndTimeHashValue(object value, Hashtable hash)
15251525
{
15261526
StringBuilder ret = new StringBuilder();
15271527
DateTime endTime = new DateTime();
@@ -1565,7 +1565,7 @@ private string HandleEndTimeHashValue(Object value, Hashtable hash)
15651565
// HandleDataHashValue helper for hashtable structured query builder.
15661566
// Constructs and returns EventData/Data XPath portion as a string.
15671567
//
1568-
private string HandleDataHashValue(Object value)
1568+
private string HandleDataHashValue(object value)
15691569
{
15701570
StringBuilder ret = new StringBuilder();
15711571
Array dataArray = value as Array;
@@ -1596,7 +1596,7 @@ private string HandleDataHashValue(Object value)
15961596
// Constructs and returns named event data field XPath portion as a string.
15971597
// Fix Issue #2327
15981598
//
1599-
private string HandleNamedDataHashValue(String key, object value)
1599+
private string HandleNamedDataHashValue(string key, object value)
16001600
{
16011601
StringBuilder ret = new StringBuilder();
16021602
Array dataArray = value as Array;
@@ -1850,7 +1850,7 @@ private void CheckHashTablesForNullValues()
18501850
Array eltArray = value as Array;
18511851
if (eltArray != null)
18521852
{
1853-
foreach (Object elt in eltArray)
1853+
foreach (object elt in eltArray)
18541854
{
18551855
if (elt == null)
18561856
{

src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2597,7 +2597,7 @@ internal bool AssignProcessToJobObject(Process process)
25972597
/// Checks to see if the JobObject is empty (has no assigned processes).
25982598
/// If job is empty the auto reset event supplied as input would be set.
25992599
/// </summary>
2600-
internal void CheckJobStatus(Object stateInfo)
2600+
internal void CheckJobStatus(object stateInfo)
26012601
{
26022602
ManualResetEvent emptyJobAutoEvent = (ManualResetEvent)stateInfo;
26032603
int dwSize = 0;

src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ internal NonscalarTypeHeader(OutGridViewCommand parentCmd, PSObject input) : bas
380380
int index = 0;
381381
foreach (string typeName in input.TypeNames)
382382
{
383-
if (index > 0 && (typeName.Equals(typeof(Object).FullName, StringComparison.OrdinalIgnoreCase) ||
383+
if (index > 0 && (typeName.Equals(typeof(object).FullName, StringComparison.OrdinalIgnoreCase) ||
384384
typeName.Equals(typeof(MarshalByRefObject).FullName, StringComparison.OrdinalIgnoreCase)))
385385
{
386386
break;

src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ internal static class HashAlgorithmNames
244244
/// <summary>
245245
/// Init a hash algorithm.
246246
/// </summary>
247-
protected void InitHasher(String Algorithm)
247+
protected void InitHasher(string Algorithm)
248248
{
249249
try
250250
{

src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Microsoft.PowerShell.Commands
2121
/// <!-- author: LukaszA -->
2222
[Cmdlet(VerbsCommon.Get, "Random", DefaultParameterSetName = GetRandomCommand.RandomNumberParameterSet,
2323
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113446", RemotingCapability = RemotingCapability.None)]
24-
[OutputType(typeof(Int32), typeof(Int64), typeof(Double))]
24+
[OutputType(typeof(Int32), typeof(Int64), typeof(double))]
2525
public class GetRandomCommand : PSCmdlet
2626
{
2727
#region Parameter set handling

src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ private class ComCreateInfo
404404

405405
private ComCreateInfo createInfo;
406406

407-
private void STAComCreateThreadProc(Object createstruct)
407+
private void STAComCreateThreadProc(object createstruct)
408408
{
409409
ComCreateInfo info = (ComCreateInfo)createstruct;
410410
try

src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ internal CultureInfo Culture
7575
/// </summary>
7676
/// <param name="inputObject">Input Object.</param>
7777
/// <returns>True if both the objects are same or else returns false.</returns>
78-
public override bool Equals(Object inputObject)
78+
public override bool Equals(object inputObject)
7979
{
8080
ObjectCommandPropertyValue objectCommandPropertyValueObject = inputObject as ObjectCommandPropertyValue;
8181
if (objectCommandPropertyValueObject == null)

src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandProxy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ internal string GetShowAllModulesCommand()
7575
return (string)_graphicalHostReflectionWrapper.CallStaticMethod("GetShowAllModulesCommand", false, true);
7676
}
7777

78-
internal Dictionary<String, ShowCommandModuleInfo> GetImportedModulesDictionary(object[] moduleObjects)
78+
internal Dictionary<string, ShowCommandModuleInfo> GetImportedModulesDictionary(object[] moduleObjects)
7979
{
80-
return (Dictionary<String, ShowCommandModuleInfo>)_graphicalHostReflectionWrapper.CallStaticMethod("GetImportedModulesDictionary", new object[] { moduleObjects });
80+
return (Dictionary<string, ShowCommandModuleInfo>)_graphicalHostReflectionWrapper.CallStaticMethod("GetImportedModulesDictionary", new object[] { moduleObjects });
8181
}
8282

8383
internal List<ShowCommandCommandInfo> GetCommandList(object[] commandObjects)

src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public int Timeout
6262

6363
private AutoResetEvent _eventArrived = new AutoResetEvent(false);
6464
private PSEventArgs _receivedEvent = null;
65-
private object _receivedEventLock = new Object();
65+
private object _receivedEventLock = new object();
6666
private WildcardPattern _matchPattern;
6767

6868
/// <summary>
@@ -112,7 +112,7 @@ protected override void StopProcessing()
112112
_eventArrived.Set();
113113
}
114114

115-
private void ReceivedEvents_PSEventReceived(Object sender, PSEventArgs e)
115+
private void ReceivedEvents_PSEventReceived(object sender, PSEventArgs e)
116116
{
117117
// If they want to wait on just any event
118118
if (_sourceIdentifier == null)

0 commit comments

Comments
 (0)