Skip to content

Commit 0f2f23f

Browse files
authored
Enable IDE0049 PreferBuiltInOrFrameworkType (PowerShell#14491)
1 parent 055b7f3 commit 0f2f23f

56 files changed

Lines changed: 262 additions & 262 deletions

File tree

Some content is hidden

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

.globalconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ dotnet_diagnostic.IDE0048.severity = suggestion
13141314

13151315
# IDE0049: PreferBuiltInOrFrameworkType
13161316
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0049
1317-
dotnet_diagnostic.IDE0049.severity = silent
1317+
dotnet_diagnostic.IDE0049.severity = warning
13181318

13191319
# IDE0050: ConvertAnonymousTypeToTuple
13201320
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0050

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ internal class ParameterSetEntry
5757
/// Initializes a new instance of the <see cref="ParameterSetEntry"/> class.
5858
/// </summary>
5959
/// <param name="mandatoryParameterCount"></param>
60-
internal ParameterSetEntry(UInt32 mandatoryParameterCount)
60+
internal ParameterSetEntry(uint mandatoryParameterCount)
6161
{
6262
this.MandatoryParameterCount = mandatoryParameterCount;
6363
this.IsDefaultParameterSet = false;
@@ -80,7 +80,7 @@ internal ParameterSetEntry(ParameterSetEntry toClone)
8080
/// </summary>
8181
/// <param name="mandatoryParameterCount"></param>
8282
/// <param name="mandatory"></param>
83-
internal ParameterSetEntry(UInt32 mandatoryParameterCount, bool isDefault)
83+
internal ParameterSetEntry(uint mandatoryParameterCount, bool isDefault)
8484
{
8585
this.MandatoryParameterCount = mandatoryParameterCount;
8686
this.IsDefaultParameterSet = isDefault;
@@ -104,7 +104,7 @@ internal void reset()
104104
/// <summary>
105105
/// Property <c>MandatoryParameterCount</c>
106106
/// </summary>
107-
internal UInt32 MandatoryParameterCount { get; } = 0;
107+
internal uint MandatoryParameterCount { get; } = 0;
108108

109109
/// <summary>
110110
/// Property <c>IsValueSet</c>
@@ -119,12 +119,12 @@ internal void reset()
119119
/// <summary>
120120
/// Property <c>SetMandatoryParameterCount</c>
121121
/// </summary>
122-
internal UInt32 SetMandatoryParameterCount { get; set; } = 0;
122+
internal uint SetMandatoryParameterCount { get; set; } = 0;
123123

124124
/// <summary>
125125
/// Property <c>SetMandatoryParameterCountAtBeginProcess</c>
126126
/// </summary>
127-
internal UInt32 SetMandatoryParameterCountAtBeginProcess { get; set; } = 0;
127+
internal uint SetMandatoryParameterCountAtBeginProcess { get; set; } = 0;
128128
}
129129

130130
/// <summary>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public CimIndicationWatcher(
153153
string theNamespace,
154154
string queryDialect,
155155
string queryExpression,
156-
UInt32 operationTimeout)
156+
uint operationTimeout)
157157
{
158158
ValidationHelper.ValidateNoNullorWhiteSpaceArgument(queryExpression, queryExpressionParameterName);
159159
computerName = ConstValue.GetComputerName(computerName);
@@ -173,7 +173,7 @@ public CimIndicationWatcher(
173173
string theNamespace,
174174
string queryDialect,
175175
string queryExpression,
176-
UInt32 operationTimeout)
176+
uint operationTimeout)
177177
{
178178
ValidationHelper.ValidateNoNullorWhiteSpaceArgument(queryExpression, queryExpressionParameterName);
179179
ValidationHelper.ValidateNoNullArgument(cimSession, cimSessionParameterName);
@@ -192,7 +192,7 @@ private void Initialize(
192192
string theNameSpace,
193193
string theQueryDialect,
194194
string theQueryExpression,
195-
UInt32 theOperationTimeout)
195+
uint theOperationTimeout)
196196
{
197197
enableRaisingEvents = false;
198198
status = Status.Default;
@@ -378,7 +378,7 @@ internal void SetCmdlet(Cmdlet cmdlet)
378378
private string nameSpace;
379379
private string queryDialect;
380380
private string queryExpression;
381-
private UInt32 operationTimeout;
381+
private uint operationTimeout;
382382
#endregion
383383
#endregion
384384
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void RegisterCimIndication(
123123
string nameSpace,
124124
string queryDialect,
125125
string queryExpression,
126-
UInt32 operationTimeout)
126+
uint operationTimeout)
127127
{
128128
DebugHelper.WriteLogEx("queryDialect = '{0}'; queryExpression = '{1}'", 0, queryDialect, queryExpression);
129129
this.TargetComputerName = computerName;
@@ -146,7 +146,7 @@ public void RegisterCimIndication(
146146
string nameSpace,
147147
string queryDialect,
148148
string queryExpression,
149-
UInt32 operationTimeout)
149+
uint operationTimeout)
150150
{
151151
DebugHelper.WriteLogEx("queryDialect = '{0}'; queryExpression = '{1}'", 0, queryDialect, queryExpression);
152152
if (cimSession == null)
@@ -317,7 +317,7 @@ internal string TargetComputerName
317317
/// <returns></returns>
318318
private CimSessionProxy CreateSessionProxy(
319319
string computerName,
320-
UInt32 timeout)
320+
uint timeout)
321321
{
322322
CimSessionProxy proxy = CreateCimSessionProxy(computerName);
323323
proxy.OperationTimeout = timeout;
@@ -332,7 +332,7 @@ private CimSessionProxy CreateSessionProxy(
332332
/// <returns></returns>
333333
private CimSessionProxy CreateSessionProxy(
334334
CimSession session,
335-
UInt32 timeout)
335+
uint timeout)
336336
{
337337
CimSessionProxy proxy = CreateCimSessionProxy(session);
338338
proxy.OperationTimeout = timeout;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,11 @@ private void CreateSetSession(
542542
/// <summary>
543543
/// Set timeout value (seconds) of the operation.
544544
/// </summary>
545-
public UInt32 OperationTimeout
545+
public uint OperationTimeout
546546
{
547547
get
548548
{
549-
return (UInt32)this.OperationOptions.Timeout.TotalSeconds;
549+
return (uint)this.OperationOptions.Timeout.TotalSeconds;
550550
}
551551

552552
set
@@ -821,7 +821,7 @@ private void FireOperationDeletedEvent(
821821
/// </summary>
822822
/// <param name="channel"></param>
823823
/// <param name="message"></param>
824-
internal void WriteMessage(UInt32 channel, string message)
824+
internal void WriteMessage(uint channel, string message)
825825
{
826826
DebugHelper.WriteLogEx("Channel = {0} message = {1}", 0, channel, message);
827827
try
@@ -863,7 +863,7 @@ internal void WriteOperationStartMessage(string operation, Hashtable parameterLi
863863
CimCmdletStrings.CimOperationStart,
864864
operation,
865865
(parameters.Length == 0) ? "null" : parameters.ToString());
866-
WriteMessage((UInt32)CimWriteMessageChannel.Verbose, operationStartMessage);
866+
WriteMessage((uint)CimWriteMessageChannel.Verbose, operationStartMessage);
867867
}
868868

869869
/// <summary>
@@ -878,7 +878,7 @@ internal void WriteOperationCompleteMessage(string operation)
878878
string operationCompleteMessage = string.Format(CultureInfo.CurrentUICulture,
879879
CimCmdletStrings.CimOperationCompleted,
880880
operation);
881-
WriteMessage((UInt32)CimWriteMessageChannel.Verbose, operationCompleteMessage);
881+
WriteMessage((uint)CimWriteMessageChannel.Verbose, operationCompleteMessage);
882882
}
883883

884884
/// <summary>
@@ -894,8 +894,8 @@ internal void WriteOperationCompleteMessage(string operation)
894894
public void WriteProgress(string activity,
895895
string currentOperation,
896896
string statusDescription,
897-
UInt32 percentageCompleted,
898-
UInt32 secondsRemaining)
897+
uint percentageCompleted,
898+
uint secondsRemaining)
899899
{
900900
DebugHelper.WriteLogEx("activity:{0}; currentOperation:{1}; percentageCompleted:{2}; secondsRemaining:{3}",
901901
0, activity, currentOperation, percentageCompleted, secondsRemaining);
@@ -1879,7 +1879,7 @@ private CimSession CreateCimSessionByComputerName(string computerName)
18791879
/// <param name="credential"></param>
18801880
/// <returns></returns>
18811881
internal static CimSessionOptions CreateCimSessionOption(string computerName,
1882-
UInt32 timeout, CimCredential credential)
1882+
uint timeout, CimCredential credential)
18831883
{
18841884
DebugHelper.WriteLogEx();
18851885

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal sealed class CimWriteMessage : CimBaseAction
2626

2727
#region Properties
2828

29-
internal UInt32 Channel { get; }
29+
internal uint Channel { get; }
3030

3131
internal string Message { get; }
3232

@@ -35,7 +35,7 @@ internal sealed class CimWriteMessage : CimBaseAction
3535
/// <summary>
3636
/// Initializes a new instance of the <see cref="CimWriteMessage"/> class.
3737
/// </summary>
38-
public CimWriteMessage(UInt32 channel,
38+
public CimWriteMessage(uint channel,
3939
string message)
4040
{
4141
this.Channel = channel;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public CimWriteProgress(
4040
int theActivityID,
4141
string theCurrentOperation,
4242
string theStatusDescription,
43-
UInt32 thePercentageCompleted,
44-
UInt32 theSecondsRemaining)
43+
uint thePercentageCompleted,
44+
uint theSecondsRemaining)
4545
{
4646
this.Activity = theActivity;
4747
this.ActivityID = theActivityID;
@@ -112,12 +112,12 @@ public override void Execute(CmdletOperationBase cmdlet)
112112
/// <summary>
113113
/// Gets the percentage completed of the given activity.
114114
/// </summary>
115-
internal UInt32 PercentageCompleted { get; }
115+
internal uint PercentageCompleted { get; }
116116

117117
/// <summary>
118118
/// Gets the number of seconds remaining for the given activity.
119119
/// </summary>
120-
internal UInt32 SecondsRemaining { get; }
120+
internal uint SecondsRemaining { get; }
121121

122122
#endregion
123123
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public CimInstance InputObject
110110
/// </summary>
111111
[Alias(AliasOT)]
112112
[Parameter(ValueFromPipelineByPropertyName = true)]
113-
public UInt32 OperationTimeoutSec { get; set; }
113+
public uint OperationTimeoutSec { get; set; }
114114

115115
/// <summary>
116116
/// <para>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public GetCimClassCommand()
7979
/// </summary>
8080
[Alias(AliasOT)]
8181
[Parameter(ValueFromPipelineByPropertyName = true)]
82-
public UInt32 OperationTimeoutSec { get; set; }
82+
public uint OperationTimeoutSec { get; set; }
8383

8484
/// <summary>
8585
/// The following is the definition of the input parameter "Session".

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public string Namespace
260260
/// </summary>
261261
[Alias(AliasOT)]
262262
[Parameter]
263-
public UInt32 OperationTimeoutSec { get; set; }
263+
public uint OperationTimeoutSec { get; set; }
264264

265265
/// <summary>
266266
/// <para>The following is the definition of the input parameter "InputObject".

0 commit comments

Comments
 (0)