Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Components
  • Loading branch information
BrennanConroy committed May 1, 2022
commit db6bc2089f1339264c7f66ece3cd3c5282fa4390
2 changes: 1 addition & 1 deletion src/Components/Analyzers/src/ComponentSymbols.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.Components.Analyzers;

internal class ComponentSymbols
internal sealed class ComponentSymbols
{
public static bool TryCreate(Compilation compilation, out ComponentSymbols symbols)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Analyzers/src/InternalUsageAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Microsoft.Extensions.Internal;

internal class InternalUsageAnalyzer
internal sealed class InternalUsageAnalyzer
{
private readonly Func<ISymbol, bool> _isInternalNamespace;
private readonly Func<ISymbol, bool> _hasInternalAttribute;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Authorization/src/AuthorizeDataAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Microsoft.AspNetCore.Components.Authorization;

// This is so the AuthorizeView can avoid implementing IAuthorizeData (even privately)
internal class AuthorizeDataAdapter : IAuthorizeData
internal sealed class AuthorizeDataAdapter : IAuthorizeData
{
private readonly AuthorizeView _component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void ComputeDiff_SingleFormField()
GC.KeepAlive(diff);
}

private class FakeRenderer : Renderer
private sealed class FakeRenderer : Renderer
{
public FakeRenderer()
: base(new TestServiceProvider(), NullLoggerFactory.Instance)
Expand All @@ -101,7 +101,7 @@ protected override Task UpdateDisplayAsync(in RenderBatch renderBatch)
=> Task.CompletedTask;
}

private class TestServiceProvider : IServiceProvider
private sealed class TestServiceProvider : IServiceProvider
{
public object GetService(Type serviceType)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/ChangeDetection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Components;

internal class ChangeDetection
internal sealed class ChangeDetection
{
public static bool MayHaveChanged<T1, T2>(T1 oldValue, T2 newValue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.Components;

internal class DefaultComponentActivator : IComponentActivator
internal sealed class DefaultComponentActivator : IComponentActivator
{
public static IComponentActivator Instance { get; } = new DefaultComponentActivator();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ private static void ThrowForInvalidCaptureUnmatchedValuesParameterType(Type targ
$"The property must be assignable from 'Dictionary<string, object>'.");
}

private class WritersForType
private sealed class WritersForType
{
private const int MaxCachedWriterLookups = 100;
private readonly Dictionary<string, PropertySetter> _underlyingWriters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Microsoft.AspNetCore.Components.Reflection;

internal class MemberAssignment
internal sealed class MemberAssignment
{
public static IEnumerable<PropertyInfo> GetPropertiesIncludingInherited(
[DynamicallyAccessedMembers(Component)] Type type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree;
/// <summary>
/// A special subclass of <see cref="ArrayBuilder{T}"/> that contains methods optimized for appending <see cref="RenderTreeFrame"/> entries.
/// </summary>
internal class RenderTreeFrameArrayBuilder : ArrayBuilder<RenderTreeFrame>
internal sealed class RenderTreeFrameArrayBuilder : ArrayBuilder<RenderTreeFrame>
{
// You may notice a repeated block at the top of each of these methods. This is intentionally inlined into each
// method because doing so improves intensive rendering scenarios by around 1% (based on the FastGrid benchmark).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree;
// balanced as in a stack. It retains up to 'maxPreservedItems' instances in
// memory, then for any further requests it supplies untracked instances.

internal class StackObjectPool<T> where T : class
internal sealed class StackObjectPool<T> where T : class
{
private readonly int _maxPreservedItems;
private readonly Func<T> _instanceFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Components.Rendering;
/// within the context of a <see cref="Renderer"/>. This is an internal implementation
/// detail of <see cref="Renderer"/>.
/// </summary>
internal class ComponentState : IDisposable
internal sealed class ComponentState : IDisposable
{
private readonly Renderer _renderer;
private readonly IReadOnlyList<CascadingParameterState> _cascadingParameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Components.Rendering;
/// and the intermediate states (such as the queue of components still to
/// be rendered).
/// </summary>
internal class RenderBatchBuilder : IDisposable
internal sealed class RenderBatchBuilder : IDisposable
{
// A value that, if changed, causes expiry of all ParameterView instances issued
// for this RenderBatchBuilder. This is to prevent invalid reads from arrays that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.Components.Rendering;

internal class RenderTreeUpdater
internal sealed class RenderTreeUpdater
{
public static void UpdateToMatchClientState(RenderTreeBuilder renderTreeBuilder, ulong eventHandlerId, object newFieldValue)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Microsoft.AspNetCore.Components.Rendering;

[DebuggerDisplay("{_state,nq}")]
internal class RendererSynchronizationContext : SynchronizationContext
internal sealed class RendererSynchronizationContext : SynchronizationContext
{
private static readonly ContextCallback ExecutionContextThunk = (object state) =>
{
Expand Down Expand Up @@ -278,7 +278,7 @@ private void DispatchException(Exception ex)
}
}

private class State
private sealed class State
{
public bool IsBusy; // Just for debugging
public object Lock = new object();
Expand All @@ -290,15 +290,15 @@ public override string ToString()
}
}

private class WorkItem
private sealed class WorkItem
{
public RendererSynchronizationContext SynchronizationContext;
public ExecutionContext ExecutionContext;
public SendOrPostCallback Callback;
public object State;
}

private class RendererSynchronizationTaskCompletionSource<TCallback, TResult> : TaskCompletionSource<TResult>
private sealed class RendererSynchronizationTaskCompletionSource<TCallback, TResult> : TaskCompletionSource<TResult>
{
public RendererSynchronizationTaskCompletionSource(TCallback callback)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Components.Rendering;

internal class RendererSynchronizationContextDispatcher : Dispatcher
internal sealed class RendererSynchronizationContextDispatcher : Dispatcher
{
private readonly RendererSynchronizationContext _context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Components.Rendering;
/// to detect when one attribute is overriding another, but in the vast majority of cases attributes don't
/// actually override each other.
/// </summary>
internal class SimplifiedStringHashComparer : IEqualityComparer<string>
internal sealed class SimplifiedStringHashComparer : IEqualityComparer<string>
{
public static readonly SimplifiedStringHashComparer Instance = new SimplifiedStringHashComparer();

Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Routing/RouteContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.AspNetCore.Components.Routing;

internal class RouteContext
internal sealed class RouteContext
{
public RouteContext(string path)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Routing/RouteEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Microsoft.AspNetCore.Components.Routing;

[DebuggerDisplay("Handler = {Handler}, Template = {Template}")]
internal class RouteEntry
internal sealed class RouteEntry
{
public RouteEntry(RouteTemplate template, [DynamicallyAccessedMembers(Component)] Type handler, List<string>? unusedRouteParameterNames)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Routing/RouteTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Components.Routing;

internal class RouteTable
internal sealed class RouteTable
{
public RouteTable(RouteEntry[] routes)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Routing/RouteTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Microsoft.AspNetCore.Components.Routing;

[DebuggerDisplay("{TemplateText}")]
internal class RouteTemplate
internal sealed class RouteTemplate
{
public RouteTemplate(string templateText, TemplateSegment[] segments)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Routing/TemplateParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Components.Routing;
// * Literal path segments. (Like /Path/To/Some/Page)
// * Parameter path segments (Like /Customer/{Id}/Orders/{OrderId})
// * Catch-all parameters (Like /blog/{*slug})
internal class TemplateParser
internal sealed class TemplateParser
{
public static readonly char[] InvalidParameterNameCharacters =
new char[] { '{', '}', '=', '.' };
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Routing/TemplateSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Components.Routing;

internal class TemplateSegment
internal sealed class TemplateSegment
{
public TemplateSegment(string template, string segment, bool isParameter)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Sections/SectionContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.Components.Sections;
/// <summary>
/// Provides content to <see cref="SectionOutlet"/> components with matching <see cref="Name"/>s.
/// </summary>
internal class SectionContent : ISectionContentProvider, IComponent, IDisposable
internal sealed class SectionContent : ISectionContentProvider, IComponent, IDisposable
{
private string? _registeredName;
private SectionRegistry _registry = default!;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/Sections/SectionOutlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.Components.Sections;
/// <summary>
/// Renders content provided by <see cref="SectionContent"/> components with matching <see cref="Name"/>s.
/// </summary>
internal class SectionOutlet : ISectionContentSubscriber, IComponent, IDisposable
internal sealed class SectionOutlet : ISectionContentSubscriber, IComponent, IDisposable
{
private static readonly RenderFragment _emptyRenderFragment = _ => { };

Expand Down
2 changes: 1 addition & 1 deletion src/Components/Forms/src/FieldState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Components.Forms;

internal class FieldState
internal sealed class FieldState
{
private readonly FieldIdentifier _fieldIdentifier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ namespace Microsoft.AspNetCore.SignalR.Internal;

// Tells SignalR not to add the IHubProtocol with this attribute to all hubs by default
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
internal class NonDefaultHubProtocolAttribute : Attribute
internal sealed class NonDefaultHubProtocolAttribute : Attribute
{
}
4 changes: 2 additions & 2 deletions src/Components/Server/src/BlazorPack/SequenceOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Nerdbank.Streams;
/// Instance members are not thread-safe.
/// </remarks>
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")]
internal class Sequence<T> : IBufferWriter<T>, IDisposable
internal sealed class Sequence<T> : IBufferWriter<T>, IDisposable
{
private static readonly int DefaultLengthFromArrayPool = 1 + (4095 / Marshal.SizeOf<T>());

Expand Down Expand Up @@ -291,7 +291,7 @@ private SequenceSegment RecycleAndGetNext(SequenceSegment segment)
return segment;
}

private class SequenceSegment : ReadOnlySequenceSegment<T>
private sealed class SequenceSegment : ReadOnlySequenceSegment<T>
{
/// <summary>
/// A value indicating whether the element is a value type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.Builder;

internal class CircuitJavaScriptInitializationMiddleware
internal sealed class CircuitJavaScriptInitializationMiddleware
{
private readonly IList<string> _initializers;

Expand Down
2 changes: 1 addition & 1 deletion src/Components/Server/src/Circuits/CircuitClientProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.AspNetCore.Components.Server.Circuits;

internal class CircuitClientProxy : IClientProxy
internal sealed class CircuitClientProxy : IClientProxy
{
public CircuitClientProxy()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Server/src/Circuits/CircuitHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits;
//
// We can't refer to Hub.Items from a CircuitHost - but we want need to be
// able to break the link between Hub.Items and a CircuitHost.
internal class CircuitHandle
internal sealed class CircuitHandle
{
public CircuitHost CircuitHost { get; set; }
}
2 changes: 2 additions & 0 deletions src/Components/Server/src/Circuits/CircuitHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

namespace Microsoft.AspNetCore.Components.Server.Circuits;

#pragma warning disable CA1852 // Seal internal types
internal partial class CircuitHost : IAsyncDisposable
#pragma warning restore CA1852 // Seal internal types
{
private readonly AsyncServiceScope _scope;
private readonly CircuitOptions _options;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Server/src/Circuits/CircuitIdFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits;

// This is a singleton instance
// Generates strong cryptographic ids for circuits that are protected with authenticated encryption.
internal class CircuitIdFactory
internal sealed class CircuitIdFactory
{
private const string CircuitIdProtectorPurpose = "Microsoft.AspNetCore.Components.Server.CircuitIdFactory,V1";

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

namespace Microsoft.AspNetCore.Components.Server.Circuits;

internal class CircuitJSComponentInterop : JSComponentInterop
internal sealed class CircuitJSComponentInterop : JSComponentInterop
{
private readonly CircuitOptions _circuitOptions;
private int _jsRootComponentCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.Components.Server;

internal class CircuitOptionsJSInteropDetailedErrorsConfiguration : IConfigureOptions<CircuitOptions>
internal sealed class CircuitOptionsJSInteropDetailedErrorsConfiguration : IConfigureOptions<CircuitOptions>
{
public CircuitOptionsJSInteropDetailedErrorsConfiguration(IConfiguration configuration)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Microsoft.AspNetCore.Components.Server.Circuits;

internal class CircuitOptionsJavaScriptInitializersConfiguration : IConfigureOptions<CircuitOptions>
internal sealed class CircuitOptionsJavaScriptInitializersConfiguration : IConfigureOptions<CircuitOptions>
{
private readonly IWebHostEnvironment _environment;

Expand Down
2 changes: 2 additions & 0 deletions src/Components/Server/src/Circuits/CircuitRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits;
/// Consequently, we have to account for reconnects and disconnects occuring simultaneously as well as appearing out of order.
/// To manage this, we use a critical section to manage all state transitions.
/// </remarks>
#pragma warning disable CA1852 // Seal internal types
internal partial class CircuitRegistry
#pragma warning restore CA1852 // Seal internal types
{
private readonly object CircuitRegistryLock = new object();
private readonly CircuitOptions _options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Microsoft.AspNetCore.Components.Server;

internal class ComponentDescriptor
internal sealed class ComponentDescriptor
{
public Type ComponentType { get; set; }

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

namespace Microsoft.AspNetCore.Components.Server.Circuits;

internal class DefaultCircuitAccessor : ICircuitAccessor
internal sealed class DefaultCircuitAccessor : ICircuitAccessor
{
public Circuit Circuit { get; set; }
}
2 changes: 2 additions & 0 deletions src/Components/Server/src/Circuits/RemoteJSRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

namespace Microsoft.AspNetCore.Components.Server.Circuits;

#pragma warning disable CA1852 // Seal internal types
internal partial class RemoteJSRuntime : JSRuntime
#pragma warning restore CA1852 // Seal internal types
{
private readonly CircuitOptions _options;
private readonly ILogger<RemoteJSRuntime> _logger;
Expand Down
Loading