Skip to content
Closed
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 @@ -19,7 +19,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
/// <summary>
/// Tracks (per-session) terminating errors in a given cmdlet invocation.
/// </summary>
internal class TerminatingErrorTracker
internal sealed class TerminatingErrorTracker
{
#region Getting tracker for a given cmdlet invocation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Microsoft.PowerShell.Cmdletization.Cim
{
internal class CimCustomOptionsDictionary
internal sealed class CimCustomOptionsDictionary
{
private readonly IDictionary<string, object> _dict;
private readonly object _dictModificationLock = new object();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,8 @@ protected void ThrowWin32Error()

#region Win32 interop helper

internal class NativeMethods
internal static class NativeMethods
{
/// <summary>
/// Private constructor to prevent instantiation.
/// </summary>
private NativeMethods()
{
}

#region Native DLL locations

private const string SetDynamicTimeZoneApiDllName = "api-ms-win-core-timezone-l1-1-0.dll";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,8 @@ private object CreateComObject()
/// <summary>
/// Native methods for dealing with COM objects.
/// </summary>
internal class NewObjectNativeMethods
internal static class NewObjectNativeMethods
{
private NewObjectNativeMethods()
{
}

/// Return Type: HRESULT->LONG->int
[DllImport(PinvokeDllNames.CLSIDFromProgIDDllName)]
internal static extern int CLSIDFromProgID([MarshalAs(UnmanagedType.LPWStr)] string lpszProgID, out Guid pclsid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void Dispose()
Dispose();
}

private class PropVariantNativeMethods
private static class PropVariantNativeMethods
{
[DllImport("Ole32.dll", PreserveSig = false)]
internal static extern void PropVariantClear([In, Out] PropVariant pvar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace System.Diagnostics.Eventing.Reader
{
internal class NativeWrapper
internal static class NativeWrapper
{
public class SystemProperties
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ namespace System.Management.Automation.SecurityAccountsManager
/// <summary>
/// Contains utility functions for formatting localizable strings.
/// </summary>
internal class StringUtil
internal static class StringUtil
{
/// <summary>
/// Private constructor to precent auto-generation of a default constructor with greater accessability.
/// </summary>
private StringUtil()
{
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal static string Format(string str)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,7 @@ internal string FQEID
/// <summary>
/// Simple string formatting helper.
/// </summary>
internal class StringUtil
internal static class StringUtil
{
internal static string Format(string formatSpec, object o)
{
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace System.Management.Automation
{
internal class NTVerpVars
internal static class NTVerpVars
{
internal const int PRODUCTMAJORVERSION = 10;
internal const int PRODUCTMINORVERSION = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace System.Management.Automation
/// <summary>
/// The powershell custom AssemblyLoadContext implementation.
/// </summary>
internal partial class PowerShellAssemblyLoadContext
internal sealed partial class PowerShellAssemblyLoadContext
{
#region Resource_Strings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.PowerShell.Commands
/// <summary>
/// Helper class for writing formatting directives to XML.
/// </summary>
internal class FormatXmlWriter
internal sealed class FormatXmlWriter
{
private XmlWriter _writer;
private bool _exportScriptBlock;
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/COM/ComUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace System.Management.Automation
/// <summary>
/// Defines a utility class that is used by COM adapter.
/// </summary>
internal class ComUtil
internal static class ComUtil
{
// HResult error code '-2147352573' - Member not found.
internal const int DISP_E_MEMBERNOTFOUND = unchecked((int)0x80020003);
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/CommandInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ public PSMemberNameAndType(string name, PSTypeName typeName, object value = null
/// but can be used where a real type might not be available, in which case the name of the type can be used.
/// The type encodes the members of dynamic objects in the type name.
/// </summary>
internal class PSSyntheticTypeName : PSTypeName
internal sealed class PSSyntheticTypeName : PSTypeName
{
internal static PSSyntheticTypeName Create(string typename, IList<PSMemberNameAndType> membersTypes) => Create(new PSTypeName(typename), membersTypes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected override void ProcessRecord()
}
}

internal class ExperimentalFeatureConfigHelper
internal static class ExperimentalFeatureConfigHelper
{
internal static void UpdateConfig(PSCmdlet cmdlet, string[] name, ConfigScope scope, bool enable)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace System.Management.Automation.Runspaces
{
internal class EarlyStartup
internal static class EarlyStartup
{
internal static void Init()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace System.Management.Automation
/// Changes to these type of modules will not be re-analyzed, unless the user re-imports the module,
/// or runs Get-Module -List.
/// </summary>
internal class AnalysisCache
internal static class AnalysisCache
{
private static AnalysisCacheData s_cacheData = AnalysisCacheData.Get();

Expand Down Expand Up @@ -642,7 +642,7 @@ private static bool GetModuleEntryFromCache(string modulePath, out DateTime last
}
}

internal class AnalysisCacheData
internal sealed class AnalysisCacheData
{
private static byte[] GetHeader()
{
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/MshMemberInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3666,7 +3666,7 @@ public override PSMemberInfo Copy()
/// <summary>
/// /// This class is used in PSMemberInfoInternalCollection and ReadOnlyPSMemberInfoCollection.
/// </summary>
internal class MemberMatch
internal static class MemberMatch
{
internal static WildcardPattern GetNamePattern(string name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace System.Management.Automation
/// <summary>
/// A class representing a name that is qualified by the PSSnapin name.
/// </summary>
internal class PSSnapinQualifiedName
internal sealed class PSSnapinQualifiedName
{
private PSSnapinQualifiedName(string[] splitName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal interface IInspectable { }
/// <summary>
/// Helper class for WinRT types.
/// </summary>
internal class WinRTHelper
internal static class WinRTHelper
{
internal static bool IsWinRTType(Type type)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace System.Management.Automation.Interpreter
{
internal class UpdatePositionInstruction : Instruction
internal sealed class UpdatePositionInstruction : Instruction
{
private readonly int _sequencePoint;
private readonly bool _checkBreakpoints;
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/parser/PSType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace System.Management.Automation.Language
{
internal class TypeDefiner
internal static class TypeDefiner
{
internal const string DynamicClassAssemblyName = "PowerShell Class Assembly";
internal const string DynamicClassAssemblyFullNamePrefix = "PowerShell Class Assembly,";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public object VisitParenExpression(ParenExpressionAst parenExpressionAst)
* except in the case of handling the unary operator
* ExecutionContext is provided to ensure we can resolve variables
*/
internal class GetSafeValueVisitor : ICustomAstVisitor2
internal sealed class GetSafeValueVisitor : ICustomAstVisitor2
{
internal enum SafeValueContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace System.Management.Automation.Language
{
internal class SemanticChecks : AstVisitor2, IAstPostVisitHandler
internal sealed class SemanticChecks : AstVisitor2, IAstPostVisitHandler
{
private readonly Parser _parser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public bool IsInMethodScope()
}
}

internal class SymbolResolver : AstVisitor2, IAstPostVisitHandler
internal sealed class SymbolResolver : AstVisitor2, IAstPostVisitHandler
{
private readonly SymbolResolvePostActionVisitor _symbolResolvePostActionVisitor;
internal readonly SymbolTable _symbolTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ public override int GetHashCode()
}
}

internal class TypeCache
internal static class TypeCache
{
private class KeyComparer : IEqualityComparer<Tuple<ITypeName, TypeResolutionState>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal VariableAnalysisDetails()
public List<Ast> AssociatedAsts { get; }
}

internal class FindAllVariablesVisitor : AstVisitor
internal sealed class FindAllVariablesVisitor : AstVisitor
{
private static readonly HashSet<string> s_hashOfPessimizingCmdlets = new HashSet<string>(StringComparer.OrdinalIgnoreCase);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace System.Management.Automation.Remoting
/// <summary>
/// Executes methods on the client.
/// </summary>
internal class ClientMethodExecutor
internal sealed class ClientMethodExecutor
{
/// <summary>
/// Transport manager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ protected override void ProcessRecord()
/// <summary>
/// Utility methods for configuration file commands.
/// </summary>
internal class SessionConfigurationUtils
internal static class SessionConfigurationUtils
{
/// <summary>
/// This routine builds a fragment of the config file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace System.Management.Automation.Remoting
/// version on the server. These capabilities will be used in remote debugging sessions to
/// determine what is supported by the server.
/// </summary>
internal class RemoteDebuggingCapability
internal sealed class RemoteDebuggingCapability
{
private readonly HashSet<string> _supportedCommands = new HashSet<string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace System.Management.Automation.Remoting
/// guarantees that transmitting on the wire will not change the encoded
/// object's type.
/// </summary>
internal class RemoteHostEncoder
internal static class RemoteHostEncoder
{
/// <summary>
/// Is known type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ internal enum HostDefaultDataId
/// <summary>
/// The HostDefaultData class.
/// </summary>
internal class HostDefaultData
internal sealed class HostDefaultData
{
/// <summary>
/// Data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private static Guid DeserializeGuid(Stream serializedDataStream)
#endregion
}

internal class RemoteDataObject : RemoteDataObject<object>
internal sealed class RemoteDataObject : RemoteDataObject<object>
{
#region Constructors / Factory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace System.Management.Automation
/// <summary>
/// Execution context used for stepping.
/// </summary>
internal class ExecutionContextForStepping : IDisposable
internal sealed class ExecutionContextForStepping : IDisposable
{
private ExecutionContext _executionContext;
private PSInformationalBuffers _originalInformationalBuffers;
Expand Down
Loading