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 @@ -193,6 +193,6 @@ public PerformanceCounterSample[] CounterSamples

private PerformanceCounterSample[] _counterSamples = null;

private ResourceManager _resourceMgr = null;
private readonly ResourceManager _resourceMgr = null;
}
}
10 changes: 5 additions & 5 deletions src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public string CounterSetName
}
}

private string _counterSetName = string.Empty;
private readonly string _counterSetName = string.Empty;

public string MachineName
{
Expand All @@ -55,7 +55,7 @@ public string MachineName
}
}

private string _machineName = ".";
private readonly string _machineName = ".";

public PerformanceCounterCategoryType CounterSetType
{
Expand All @@ -65,7 +65,7 @@ public PerformanceCounterCategoryType CounterSetType
}
}

private PerformanceCounterCategoryType _counterSetType;
private readonly PerformanceCounterCategoryType _counterSetType;

public string Description
{
Expand All @@ -75,7 +75,7 @@ public string Description
}
}

private string _description = string.Empty;
private readonly string _description = string.Empty;

internal Dictionary<string, string[]> CounterInstanceMapping
{
Expand All @@ -85,7 +85,7 @@ internal Dictionary<string, string[]> CounterInstanceMapping
}
}

private Dictionary<string, string[]> _counterInstanceMapping;
private readonly Dictionary<string, string[]> _counterInstanceMapping;

public StringCollection Paths
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public string[] Counter

private bool _defaultCounters = true;

private List<string> _accumulatedCounters = new List<string>();
private readonly List<string> _accumulatedCounters = new List<string>();

//
// SampleInterval parameter.
Expand Down Expand Up @@ -180,7 +180,7 @@ public string[] ComputerName

private PdhHelper _pdhHelper = null;

private EventWaitHandle _cancelEventArrived = new EventWaitHandle(false, EventResetMode.ManualReset);
private readonly EventWaitHandle _cancelEventArrived = new EventWaitHandle(false, EventResetMode.ManualReset);

// Culture identifier(s)
private const string FrenchCultureId = "fr-FR";
Expand Down
10 changes: 5 additions & 5 deletions src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,14 @@ public SwitchParameter Oldest
// Other private members and constants
//
private ResourceManager _resourceMgr = null;
private Dictionary<string, StringCollection> _providersByLogMap = new Dictionary<string, StringCollection>();
private readonly Dictionary<string, StringCollection> _providersByLogMap = new Dictionary<string, StringCollection>();

private StringCollection _logNamesMatchingWildcard = null;
private StringCollection _resolvedPaths = new StringCollection();
private readonly StringCollection _resolvedPaths = new StringCollection();

private List<string> _accumulatedLogNames = new List<string>();
private List<string> _accumulatedProviderNames = new List<string>();
private List<string> _accumulatedFileNames = new List<string>();
private readonly List<string> _accumulatedLogNames = new List<string>();
private readonly List<string> _accumulatedProviderNames = new List<string>();
private readonly List<string> _accumulatedFileNames = new List<string>();

private const uint MAX_EVENT_BATCH = 100;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed class NewWinEventCommand : PSCmdlet
private const string TemplateTag = "template";
private const string DataTag = "data";

private ResourceManager _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager();
private readonly ResourceManager _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager();

/// <summary>
/// ProviderName.
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public void Dispose()
//
// m_ConsumerPathToHandleAndInstanceMap map is used for reading counter date (live or from files).
//
private Dictionary<string, CounterHandleNInstance> _consumerPathToHandleAndInstanceMap = new Dictionary<string, CounterHandleNInstance>();
private readonly Dictionary<string, CounterHandleNInstance> _consumerPathToHandleAndInstanceMap = new Dictionary<string, CounterHandleNInstance>();

/// <summary>
/// A helper reading in a Unicode string with embedded NULLs and splitting it into a StringCollection.
Expand Down