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 @@ -26,7 +26,7 @@ namespace Microsoft.PowerShell.Cim
{
internal class CimSensitiveValueConverter : IDisposable
{
private class SensitiveString : IDisposable
private sealed class SensitiveString : IDisposable
{
private GCHandle _gcHandle;
private string _string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected override bool IsMatchCore(CimInstance cimInstance)
}
}

private class CimInstanceRegularFilter : CimInstancePropertyBasedFilter
private sealed class CimInstanceRegularFilter : CimInstancePropertyBasedFilter
{
public CimInstanceRegularFilter(string propertyName, IEnumerable allowedPropertyValues, bool wildcardsEnabled, BehaviorOnNoMatch behaviorOnNoMatch)
{
Expand Down Expand Up @@ -247,7 +247,7 @@ public override IEnumerable<NotFoundError> GetNotFoundErrors_IfThisIsTheOnlyFilt
}
}

private class CimInstanceExcludeFilter : CimInstancePropertyBasedFilter
private sealed class CimInstanceExcludeFilter : CimInstancePropertyBasedFilter
{
public CimInstanceExcludeFilter(string propertyName, IEnumerable excludedPropertyValues, bool wildcardsEnabled, BehaviorOnNoMatch behaviorOnNoMatch)
{
Expand All @@ -272,7 +272,7 @@ public CimInstanceExcludeFilter(string propertyName, IEnumerable excludedPropert
}
}

private class CimInstanceMinFilter : CimInstancePropertyBasedFilter
private sealed class CimInstanceMinFilter : CimInstancePropertyBasedFilter
{
public CimInstanceMinFilter(string propertyName, object minPropertyValue, BehaviorOnNoMatch behaviorOnNoMatch)
{
Expand All @@ -293,7 +293,7 @@ public CimInstanceMinFilter(string propertyName, object minPropertyValue, Behavi
}
}

private class CimInstanceMaxFilter : CimInstancePropertyBasedFilter
private sealed class CimInstanceMaxFilter : CimInstancePropertyBasedFilter
{
public CimInstanceMaxFilter(string propertyName, object minPropertyValue, BehaviorOnNoMatch behaviorOnNoMatch)
{
Expand All @@ -314,7 +314,7 @@ public CimInstanceMaxFilter(string propertyName, object minPropertyValue, Behavi
}
}

private class CimInstanceAssociationFilter : CimInstanceFilterBase
private sealed class CimInstanceAssociationFilter : CimInstanceFilterBase
{
public CimInstanceAssociationFilter(BehaviorOnNoMatch behaviorOnNoMatch)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ private void OnTimedEvent(object s)
}
}

private class ComputerInfo
private sealed class ComputerInfo
{
internal string LastBootUpTime;
internal bool RebootComplete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Microsoft.PowerShell.Commands
public class GetComputerInfoCommand : PSCmdlet
{
#region Inner Types
private class OSInfoGroup
private sealed class OSInfoGroup
{
public WmiOperatingSystem os;
public HotFix[] hotFixes;
Expand All @@ -41,7 +41,7 @@ private class OSInfoGroup
public RegWinNtCurrentVersion regCurVer;
}

private class SystemInfoGroup
private sealed class SystemInfoGroup
{
public WmiBaseBoard baseboard;
public WmiBios bios;
Expand All @@ -50,7 +50,7 @@ private class SystemInfoGroup
public NetworkAdapter[] networkAdapters;
}

private class HyperVInfo
private sealed class HyperVInfo
{
public bool? Present;
public bool? VMMonitorModeExtensions;
Expand All @@ -59,13 +59,13 @@ private class HyperVInfo
public bool? DataExecutionPreventionAvailable;
}

private class DeviceGuardInfo
private sealed class DeviceGuardInfo
{
public DeviceGuardSmartStatus status;
public DeviceGuard deviceGuard;
}

private class MiscInfoGroup
private sealed class MiscInfoGroup
{
public ulong? physicallyInstalledMemory;
public string timeZone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ private void CheckDuplicateTypes(Compilation compilation, out ConcurrentBag<stri
}

// Visit symbols in all namespaces and collect duplicates.
private class AllNamedTypeSymbolsVisitor : SymbolVisitor
private sealed class AllNamedTypeSymbolsVisitor : SymbolVisitor
{
public readonly ConcurrentBag<string> DuplicateSymbols = new();
public readonly ConcurrentBag<string> UniqueSymbols = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected override void ProcessRecord()
}
}

private class MemberComparer : System.Collections.Generic.IComparer<MemberDefinition>
private sealed class MemberComparer : System.Collections.Generic.IComparer<MemberDefinition>
{
public int Compare(MemberDefinition first, MemberDefinition second)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public sealed class SelectStringCommand : PSCmdlet
/// A generic circular buffer.
/// </summary>
/// <typeparam name="T">The type of items that are buffered.</typeparam>
private class CircularBuffer<T> : ICollection<T>
private sealed class CircularBuffer<T> : ICollection<T>
{
// Ring of items
private readonly T[] _items;
Expand Down Expand Up @@ -627,7 +627,7 @@ private interface IContextTracker
/// <summary>
/// A state machine to track display context for each match.
/// </summary>
private class DisplayContextTracker : IContextTracker
private sealed class DisplayContextTracker : IContextTracker
{
private enum ContextState
{
Expand Down Expand Up @@ -784,12 +784,12 @@ private void Reset()
/// and other matching lines (since they will appear
/// as their own match entries.).
/// </remarks>
private class LogicalContextTracker : IContextTracker
private sealed class LogicalContextTracker : IContextTracker
{
// A union: string | MatchInfo. Needed since
// context lines could be either proper matches
// or non-matching lines.
private class ContextEntry
private sealed class ContextEntry
{
public readonly string Line;
public readonly MatchInfo Match;
Expand Down Expand Up @@ -989,7 +989,7 @@ private string[] CopyContext(int startIndex, int length)
/// <summary>
/// A class to track both logical and display contexts.
/// </summary>
private class ContextTracker : IContextTracker
private sealed class ContextTracker : IContextTracker
{
private readonly IContextTracker _displayTracker;
private readonly IContextTracker _logicalTracker;
Expand Down Expand Up @@ -1058,7 +1058,7 @@ private void UpdateQueue()
/// <summary>
/// ContextTracker that does not work for the case when pre- and post context is 0.
/// </summary>
private class NoContextTracker : IContextTracker
private sealed class NoContextTracker : IContextTracker
{
private readonly IList<MatchInfo> _matches = new List<MatchInfo>(1);

Expand Down Expand Up @@ -1996,7 +1996,7 @@ private void WarnFilterContext()
/// <summary>
/// Magic class that works around the limitations on ToString() for FileInfo.
/// </summary>
private class FileinfoToStringAttribute : ArgumentTransformationAttribute
private sealed class FileinfoToStringAttribute : ArgumentTransformationAttribute
{
public override object Transform(EngineIntrinsics engineIntrinsics, object inputData)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public sealed class MeasureObjectCommand : PSCmdlet
/// Keys are strings. Keys are compared with OrdinalIgnoreCase.
/// </summary>
/// <typeparam name="TValue">Value type.</typeparam>
private class MeasureObjectDictionary<TValue> : Dictionary<string, TValue>
private sealed class MeasureObjectDictionary<TValue> : Dictionary<string, TValue>
where TValue : new()
{
/// <summary>
Expand Down Expand Up @@ -200,7 +200,7 @@ public TValue EnsureEntry(string key)
/// what mode we're in.
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
private class Statistics
private sealed class Statistics
{
// Common properties
internal int count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private object SafeCreateInstance(Type t, object[] args)
return result;
}

private class ComCreateInfo
private sealed class ComCreateInfo
{
public object objectCreated;
public bool success;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public int[] SkipIndex

private SelectObjectQueue _selectObjectQueue;

private class SelectObjectQueue : Queue<PSObject>
private sealed class SelectObjectQueue : Queue<PSObject>
{
internal SelectObjectQueue(int first, int last, int skip, int skipLast, bool firstOrLastSpecified)
{
Expand Down Expand Up @@ -324,7 +324,7 @@ public PSObject StreamingDequeue()

private PSPropertyExpressionFilter _exclusionFilter;

private class UniquePSObjectHelper
private sealed class UniquePSObjectHelper
{
internal UniquePSObjectHelper(PSObject o, int notePropertyCount)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public ConvertToJsonContext(
}
}

private class DuplicateMemberHashSet : HashSet<string>
private sealed class DuplicateMemberHashSet : HashSet<string>
{
public DuplicateMemberHashSet(int capacity)
: base(capacity, StringComparer.OrdinalIgnoreCase)
Expand Down
6 changes: 3 additions & 3 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ private void WriteDebuggerMessage(string line)
/// Neither this class' instances nor its static data is threadsafe. Caller is responsible for ensuring threadsafe
/// access.
/// </summary>
private class InputLoop
private sealed class InputLoop
{
internal static void RunNewInputLoop(ConsoleHost parent, bool isNested)
{
Expand Down Expand Up @@ -2902,7 +2902,7 @@ private string EvaluateDebugPrompt()
[Serializable]
[SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic", Justification =
"This exception cannot be used outside of the console host application. It is not thrown by a library routine, only by an application.")]
private class ConsoleHostStartupException : Exception
private sealed class ConsoleHostStartupException : Exception
{
internal
ConsoleHostStartupException()
Expand All @@ -2916,7 +2916,7 @@ private class ConsoleHostStartupException : Exception
{
}

protected
private
ConsoleHostStartupException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void AsyncPipelineFailureHandler(Exception ex)
_parent.ErrorSerializer.Serialize(er);
}

private class PipelineFinishedWaitHandle
private sealed class PipelineFinishedWaitHandle
{
internal PipelineFinishedWaitHandle(Pipeline p)
{
Expand Down
12 changes: 4 additions & 8 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ class PendingProgress
#endif
}

private
class FindOldestNodeVisitor : NodeVisitor
private sealed class FindOldestNodeVisitor : NodeVisitor
{
internal override
bool
Expand Down Expand Up @@ -366,8 +365,7 @@ internal override
FindNodeById(sourceId, activityId, out listWhereFound, out indexWhereFound);
}

private
class FindByIdNodeVisitor : NodeVisitor
private sealed class FindByIdNodeVisitor : NodeVisitor
{
internal
FindByIdNodeVisitor(Int64 sourceIdToFind, int activityIdToFind)
Expand Down Expand Up @@ -508,8 +506,7 @@ internal override
return found;
}

private
class AgeAndResetStyleVisitor : NodeVisitor
private sealed class AgeAndResetStyleVisitor : NodeVisitor
{
internal override
bool
Expand Down Expand Up @@ -666,8 +663,7 @@ internal override
}
}

private
class HeightTallyer : NodeVisitor
private sealed class HeightTallyer : NodeVisitor
{
internal HeightTallyer(PSHostRawUserInterface rawUi, int maxHeight, int maxWidth)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ private enum NotificationType
LTS = 2
}

private class Release
private sealed class Release
{
internal Release(string publishAt, string tagName)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private enum ContextObjectType
/// Used primarily by the private ThrowOnFailure method when building
/// Exception objects to throw.
/// </remarks>
private class Context
private sealed class Context
{
public ContextOperation operation;
public ContextObjectType type;
Expand Down Expand Up @@ -308,7 +308,7 @@ public string MemberName
/// AccountInfo is the return type from the private
/// LookupAccountInfo method.
/// </remarks>
private class AccountInfo
private sealed class AccountInfo
{
public string AccountName;
public string DomainName;
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ private void RemoveSetShouldExitFromHost()
#region Private ResultsInfo class

[Serializable]
private class ResultsInfo : ISerializable
private sealed class ResultsInfo : ISerializable
{
// Private Members
private Collection<PSObject> _output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ private FormattingHint RetrieveFormattingHint()
/// <summary>
/// Context for the outer scope of the format sequence.
/// </summary>
private class FormatOutputContext : FormatMessagesContextManager.OutputContext
private sealed class FormatOutputContext : FormatMessagesContextManager.OutputContext
{
/// <summary>
/// Construct a context to push on the stack.
Expand Down Expand Up @@ -1296,7 +1296,7 @@ private void WriteStringBuffer()
/// Helper class to accumulate the display values so that when the end
/// of a line is reached, a full line can be composed.
/// </summary>
private class StringValuesBuffer
private sealed class StringValuesBuffer
{
/// <summary>
/// Construct the buffer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private sealed class AssemblyLoadResult
/// Helper class to resolve an assembly name to an assembly reference
/// The class caches previous results for faster lookup.
/// </summary>
private class AssemblyNameResolver
private sealed class AssemblyNameResolver
{
/// <summary>
/// Resolve the assembly name against the set of loaded assemblies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class TableWriter
/// <summary>
/// Information about each column boundaries.
/// </summary>
private class ColumnInfo
private sealed class ColumnInfo
{
internal int startCol = 0;
internal int width = 0;
Expand All @@ -25,7 +25,7 @@ private class ColumnInfo
/// <summary>
/// Class containing information about the tabular layout.
/// </summary>
private class ScreenInfo
private sealed class ScreenInfo
{
internal int screenColumns = 0;
internal int screenRows = 0;
Expand Down
Loading