Style fixes for CimAsyncOperations (#9945)
This commit is contained in:
parent
092ab5f6eb
commit
4ae04335a4
|
@ -6,9 +6,9 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Management.Automation;
|
||||
using System.Threading;
|
||||
using System.Globalization;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -81,14 +81,14 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="cimSession">
|
||||
/// <seealso cref="CimSession"/> object raised the event
|
||||
/// <seealso cref="CimSession"/> object raised the event.
|
||||
/// </param>
|
||||
/// <param name="actionArgs">Event argument.</param>
|
||||
protected void OperationCreatedHandler(object cimSession, OperationEventArgs actionArgs)
|
||||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
|
||||
lock (this.myLock)
|
||||
lock (this.a_lock)
|
||||
{
|
||||
this.operationCount++;
|
||||
}
|
||||
|
@ -101,14 +101,14 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="cimSession">
|
||||
/// <seealso cref="CimSession"/> object raised the event
|
||||
/// <seealso cref="CimSession"/> object raised the event.
|
||||
/// </param>
|
||||
/// <param name="actionArgs">Event argument.</param>
|
||||
protected void OperationDeletedHandler(object cimSession, OperationEventArgs actionArgs)
|
||||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
|
||||
lock (this.myLock)
|
||||
lock (this.a_lock)
|
||||
{
|
||||
this.operationCount--;
|
||||
if (this.operationCount == 0)
|
||||
|
@ -126,7 +126,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="cmdletOperation">
|
||||
/// wrapper of cmdlet, <seealso cref="CmdletOperationBase"/> for details
|
||||
/// wrapper of cmdlet, <seealso cref="CmdletOperationBase"/> for details.
|
||||
/// </param>
|
||||
public void ProcessActions(CmdletOperationBase cmdletOperation)
|
||||
{
|
||||
|
@ -147,11 +147,11 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// <para>
|
||||
/// process remaining actions until all operations are completed or
|
||||
/// current cmdlet is terminated by user
|
||||
/// current cmdlet is terminated by user.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="cmdletOperation">
|
||||
/// wrapper of cmdlet, <seealso cref="CmdletOperationBase"/> for details
|
||||
/// wrapper of cmdlet, <seealso cref="CmdletOperationBase"/> for details.
|
||||
/// </param>
|
||||
public void ProcessRemainActions(CmdletOperationBase cmdletOperation)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Get action object from action queue
|
||||
/// Get action object from action queue.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="action">Next action to execute.</param>
|
||||
|
@ -296,8 +296,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <param name="computerName"></param>
|
||||
/// <param name="cimInstance"></param>
|
||||
/// <returns></returns>
|
||||
protected CimSessionProxy CreateCimSessionProxy(string computerName,
|
||||
CimInstance cimInstance)
|
||||
protected CimSessionProxy CreateCimSessionProxy(string computerName, CimInstance cimInstance)
|
||||
{
|
||||
CimSessionProxy proxy = new CimSessionProxy(computerName, cimInstance);
|
||||
this.SubscribeEventAndAddProxytoCache(proxy);
|
||||
|
@ -445,7 +444,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
get
|
||||
{
|
||||
return (Interlocked.Read(ref this._disposed) == 1);
|
||||
return Interlocked.Read(ref this._disposed) == 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -461,6 +460,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
|
||||
// This object will be cleaned up by the Dispose method.
|
||||
// Therefore, you should call GC.SuppressFinalize to
|
||||
// take this object off the finalization queue
|
||||
|
@ -525,6 +525,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
temporaryProxy = new List<CimSessionProxy>(this.cimSessionProxyCache);
|
||||
this.cimSessionProxyCache.Clear();
|
||||
}
|
||||
|
||||
// clean up all proxy objects
|
||||
foreach (CimSessionProxy proxy in temporaryProxy)
|
||||
{
|
||||
|
@ -549,12 +550,12 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// Lock object.
|
||||
/// </summary>
|
||||
private readonly object myLock = new object();
|
||||
private readonly object a_lock = new object();
|
||||
|
||||
/// <summary>
|
||||
/// Number of active operations.
|
||||
/// </summary>
|
||||
private UInt32 operationCount = 0;
|
||||
private uint operationCount;
|
||||
|
||||
/// <summary>
|
||||
/// Event to notify ps thread that more action is available.
|
||||
|
@ -594,6 +595,5 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
internal const string ComputerNameArgument = @"ComputerName";
|
||||
internal const string CimSessionArgument = @"CimSession";
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue