Fix spelling and grammar in Components (#14137)

This commit is contained in:
Adrian Wright 2019-09-19 18:11:28 +01:00 committed by Pranav K
parent 29e9c77026
commit c74e9efd0e
36 changed files with 114 additions and 114 deletions

View File

@ -8,9 +8,9 @@ using Xunit;
namespace Microsoft.AspNetCore.Components.Analyzers
{
public class ComponentInternalUsageDiagnoticsAnalyzerTest : AnalyzerTestBase
public class ComponentInternalUsageDiagnosticsAnalyzerTest : AnalyzerTestBase
{
public ComponentInternalUsageDiagnoticsAnalyzerTest()
public ComponentInternalUsageDiagnosticsAnalyzerTest()
{
Analyzer = new ComponentInternalUsageDiagnosticAnalyzer();
Runner = new ComponentAnalyzerDiagnosticAnalyzerRunner(Analyzer);

View File

@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Components.RenderTree;
namespace Microsoft.AspNetCore.Components.Analyzers.Tests.TestFiles.ComponentInternalUsageDiagnoticsAnalyzerTest
namespace Microsoft.AspNetCore.Components.Analyzers.Tests.TestFiles.ComponentInternalUsageDiagnosticsAnalyzerTest
{
class UsesRenderTreeFrameAsParameter
{

View File

@ -1,7 +1,7 @@
using System;
using Microsoft.AspNetCore.Components.RenderTree;
namespace Microsoft.AspNetCore.Components.Analyzers.Tests.TestFiles.ComponentInternalUsageDiagnoticsAnalyzerTest
namespace Microsoft.AspNetCore.Components.Analyzers.Tests.TestFiles.ComponentInternalUsageDiagnosticsAnalyzerTest
{
class UsesRenderTreeFrameTypeAsLocal
{

View File

@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Blazor.Hosting
public static void Run(this IWebAssemblyHost host)
{
// Behave like async void, because we don't yet support async-main properly on WebAssembly.
// However, don't actualy make this method async, because we rely on startup being synchronous
// However, don't actually make this method async, because we rely on startup being synchronous
// for things like attaching navigation event handlers.
host.StartAsync().ContinueWith(task =>
{

View File

@ -96,7 +96,7 @@ namespace Test
}
[Fact]
public void Render_ChildComponent_TriesToSetNonParamter()
public void Render_ChildComponent_TriesToSetNonParameter()
{
// Arrange
AdditionalSyntaxTrees.Add(Parse(@"

View File

@ -100,7 +100,7 @@ namespace WsProxy {
break;
}
case "Debugger.paused": {
//TODO figure out how to stich out more frames and, in particular what happens when real wasm is on the stack
//TODO figure out how to stitch out more frames and, in particular what happens when real wasm is on the stack
var top_func = args? ["callFrames"]? [0]? ["functionName"]?.Value<string> ();
if (top_func == "mono_wasm_fire_bp" || top_func == "_mono_wasm_fire_bp") {
await OnBreakPointHit (args, token);
@ -419,7 +419,7 @@ namespace WsProxy {
var res = await SendCommand("Runtime.evaluate", o, token);
//if we fail we just buble that to the IDE (and let it panic over it)
//if we fail we just bubble that to the IDE (and let it panic over it)
if (res.IsErr)
{
SendResponse(msg_id, res, token);
@ -475,7 +475,7 @@ namespace WsProxy {
var res = await SendCommand ("Runtime.evaluate", o, token);
//if we fail we just buble that to the IDE (and let it panic over it)
//if we fail we just bubble that to the IDE (and let it panic over it)
if (res.IsErr) {
SendResponse (msg_id, res, token);
return;
@ -594,7 +594,7 @@ namespace WsProxy {
var res = await EnableBreakPoint (bp, token);
var ret_code = res.Value? ["result"]? ["value"]?.Value<int> ();
//if we fail we just buble that to the IDE (and let it panic over it)
//if we fail we just bubble that to the IDE (and let it panic over it)
if (!ret_code.HasValue) {
//FIXME figure out how to inform the IDE of that.
Info ($"FAILED TO ENABLE BP {bp.LocalId}");
@ -668,7 +668,7 @@ namespace WsProxy {
var res = await EnableBreakPoint (bp, token);
var ret_code = res.Value? ["result"]? ["value"]?.Value<int> ();
//if we fail we just buble that to the IDE (and let it panic over it)
//if we fail we just bubble that to the IDE (and let it panic over it)
if (!ret_code.HasValue) {
SendResponse (msg_id, res, token);
return;

View File

@ -430,7 +430,7 @@ namespace Microsoft.AspNetCore.Components
private static string FormatEnumValueCore<T>(T value, CultureInfo culture) where T : struct, Enum
{
return value.ToString(); // The overload that acccepts a culture is [Obsolete]
return value.ToString(); // The overload that accepts a culture is [Obsolete]
}
private static string FormatNullableEnumValueCore<T>(T? value, CultureInfo culture) where T : struct, Enum
@ -440,7 +440,7 @@ namespace Microsoft.AspNetCore.Components
return null;
}
return value.Value.ToString(); // The overload that acccepts a culture is [Obsolete]
return value.Value.ToString(); // The overload that accepts a culture is [Obsolete]
}
/// <summary>
@ -1166,99 +1166,99 @@ namespace Microsoft.AspNetCore.Components
public static BindFormatter<T> Get<T>()
{
if (!_cache.TryGetValue(typeof(T), out var formattter))
if (!_cache.TryGetValue(typeof(T), out var formatter))
{
// We need to replicate all of the primitive cases that we handle here so that they will behave the same way.
// The result will be cached.
if (typeof(T) == typeof(string))
{
formattter = (BindFormatter<string>)FormatStringValueCore;
formatter = (BindFormatter<string>)FormatStringValueCore;
}
else if (typeof(T) == typeof(bool))
{
formattter = (BindFormatter<bool>)FormatBoolValueCore;
formatter = (BindFormatter<bool>)FormatBoolValueCore;
}
else if (typeof(T) == typeof(bool?))
{
formattter = (BindFormatter<bool?>)FormatNullableBoolValueCore;
formatter = (BindFormatter<bool?>)FormatNullableBoolValueCore;
}
else if (typeof(T) == typeof(int))
{
formattter = (BindFormatter<int>)FormatIntValueCore;
formatter = (BindFormatter<int>)FormatIntValueCore;
}
else if (typeof(T) == typeof(int?))
{
formattter = (BindFormatter<int?>)FormatNullableIntValueCore;
formatter = (BindFormatter<int?>)FormatNullableIntValueCore;
}
else if (typeof(T) == typeof(long))
{
formattter = (BindFormatter<long>)FormatLongValueCore;
formatter = (BindFormatter<long>)FormatLongValueCore;
}
else if (typeof(T) == typeof(long?))
{
formattter = (BindFormatter<long?>)FormatNullableLongValueCore;
formatter = (BindFormatter<long?>)FormatNullableLongValueCore;
}
else if (typeof(T) == typeof(float))
{
formattter = (BindFormatter<float>)FormatFloatValueCore;
formatter = (BindFormatter<float>)FormatFloatValueCore;
}
else if (typeof(T) == typeof(float?))
{
formattter = (BindFormatter<float?>)FormatNullableFloatValueCore;
formatter = (BindFormatter<float?>)FormatNullableFloatValueCore;
}
else if (typeof(T) == typeof(double))
{
formattter = (BindFormatter<double>)FormatDoubleValueCore;
formatter = (BindFormatter<double>)FormatDoubleValueCore;
}
else if (typeof(T) == typeof(double?))
{
formattter = (BindFormatter<double?>)FormatNullableDoubleValueCore;
formatter = (BindFormatter<double?>)FormatNullableDoubleValueCore;
}
else if (typeof(T) == typeof(decimal))
{
formattter = (BindFormatter<decimal>)FormatDecimalValueCore;
formatter = (BindFormatter<decimal>)FormatDecimalValueCore;
}
else if (typeof(T) == typeof(decimal?))
{
formattter = (BindFormatter<decimal?>)FormatNullableDecimalValueCore;
formatter = (BindFormatter<decimal?>)FormatNullableDecimalValueCore;
}
else if (typeof(T) == typeof(DateTime))
{
formattter = (BindFormatter<DateTime>)FormatDateTimeValueCore;
formatter = (BindFormatter<DateTime>)FormatDateTimeValueCore;
}
else if (typeof(T) == typeof(DateTime?))
{
formattter = (BindFormatter<DateTime?>)FormatNullableDateTimeValueCore;
formatter = (BindFormatter<DateTime?>)FormatNullableDateTimeValueCore;
}
else if (typeof(T) == typeof(DateTimeOffset))
{
formattter = (BindFormatter<DateTimeOffset>)FormatDateTimeOffsetValueCore;
formatter = (BindFormatter<DateTimeOffset>)FormatDateTimeOffsetValueCore;
}
else if (typeof(T) == typeof(DateTimeOffset?))
{
formattter = (BindFormatter<DateTimeOffset?>)FormatNullableDateTimeOffsetValueCore;
formatter = (BindFormatter<DateTimeOffset?>)FormatNullableDateTimeOffsetValueCore;
}
else if (typeof(T).IsEnum)
{
// We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse.
var method = _formatEnumValue ??= typeof(BindConverter).GetMethod(nameof(FormatEnumValueCore), BindingFlags.NonPublic | BindingFlags.Static);
formattter = method.MakeGenericMethod(typeof(T)).CreateDelegate(typeof(BindFormatter<T>), target: null);
formatter = method.MakeGenericMethod(typeof(T)).CreateDelegate(typeof(BindFormatter<T>), target: null);
}
else if (Nullable.GetUnderlyingType(typeof(T)) is Type innerType && innerType.IsEnum)
{
// We have to deal invoke this dynamically to work around the type constraint on Enum.TryParse.
var method = _formatNullableEnumValue ??= typeof(BindConverter).GetMethod(nameof(FormatNullableEnumValueCore), BindingFlags.NonPublic | BindingFlags.Static);
formattter = method.MakeGenericMethod(innerType).CreateDelegate(typeof(BindFormatter<T>), target: null);
formatter = method.MakeGenericMethod(innerType).CreateDelegate(typeof(BindFormatter<T>), target: null);
}
else
{
formattter = MakeTypeConverterFormatter<T>();
formatter = MakeTypeConverterFormatter<T>();
}
_cache.TryAdd(typeof(T), formattter);
_cache.TryAdd(typeof(T), formatter);
}
return (BindFormatter<T>)formattter;
return (BindFormatter<T>)formatter;
}
private static BindFormatter<T> MakeTypeConverterFormatter<T>()

View File

@ -105,7 +105,7 @@ namespace Microsoft.AspNetCore.Components
_hasSetParametersPreviously = true;
// It's OK for the value to be null, but some "Value" param must be suppled
// It's OK for the value to be null, but some "Value" param must be supplied
// because it serves no useful purpose to have a <CascadingValue> otherwise.
if (!hasSuppliedValue)
{

View File

@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Components
// about IComponent). This gives us flexibility to change the lifecycle concepts easily,
// or for developers to design their own lifecycles as different base classes.
// TODO: When the component lifecycle design stabilises, add proper unit tests for ComponentBase.
// TODO: When the component lifecycle design stabilizes, add proper unit tests for ComponentBase.
/// <summary>
/// Optional base class for components. Alternatively, components may
@ -136,7 +136,7 @@ namespace Microsoft.AspNetCore.Components
/// </param>
/// <remarks>
/// The <see cref="OnAfterRender(bool)"/> and <see cref="OnAfterRenderAsync(bool)"/> lifecycle methods
/// are useful for performing interop, or interacting with values recieved from <c>@ref</c>.
/// are useful for performing interop, or interacting with values received from <c>@ref</c>.
/// Use the <paramref name="firstRender"/> parameter to ensure that initialization work is only performed
/// once.
/// </remarks>
@ -156,7 +156,7 @@ namespace Microsoft.AspNetCore.Components
/// <returns>A <see cref="Task"/> representing any asynchronous operation.</returns>
/// <remarks>
/// The <see cref="OnAfterRender(bool)"/> and <see cref="OnAfterRenderAsync(bool)"/> lifecycle methods
/// are useful for performing interop, or interacting with values recieved from <c>@ref</c>.
/// are useful for performing interop, or interacting with values received from <c>@ref</c>.
/// Use the <paramref name="firstRender"/> parameter to ensure that initialization work is only performed
/// once.
/// </remarks>
@ -246,7 +246,7 @@ namespace Microsoft.AspNetCore.Components
}
catch // avoiding exception filters for AOT runtime support
{
// Ignore exceptions from task cancelletions.
// Ignore exceptions from task cancellations.
// Awaiting a canceled task may produce either an OperationCanceledException (if produced as a consequence of
// CancellationToken.ThrowIfCancellationRequested()) or a TaskCanceledException (produced as a consequence of awaiting Task.FromCanceled).
// It's much easier to check the state of the Task (i.e. Task.IsCanceled) rather than catch two distinct exceptions.
@ -289,7 +289,7 @@ namespace Microsoft.AspNetCore.Components
}
catch // avoiding exception filters for AOT runtime support
{
// Ignore exceptions from task cancelletions, but don't bother issuing a state change.
// Ignore exceptions from task cancellations, but don't bother issuing a state change.
if (task.IsCanceled)
{
return;

View File

@ -12,9 +12,9 @@ namespace Microsoft.AspNetCore.Components
/// </summary>
//
// NOTE: for number parsing, the HTML5 spec dictates that <input type="number"> the DOM will represent
// number values as floating point numbers using `.` as the period separator. This is NOT culture senstive.
// number values as floating point numbers using `.` as the period separator. This is NOT culture sensitive.
// Put another way, the user might see `,` as their decimal separator, but the value available in events
// to JS code is always simpilar to what .NET parses with InvariantCulture.
// to JS code is always similar to what .NET parses with InvariantCulture.
//
// See: https://www.w3.org/TR/html5/sec-forms.html#number-state-typenumber
// See: https://www.w3.org/TR/html5/infrastructure.html#valid-floating-point-number

View File

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Components.Routing;
namespace Microsoft.AspNetCore.Components
{
/// <summary>
/// Provides an abstraction for querying and mananging URI navigation.
/// Provides an abstraction for querying and managing URI navigation.
/// </summary>
public abstract class NavigationManager
{
@ -134,7 +134,7 @@ namespace Microsoft.AspNetCore.Components
}
/// <summary>
/// Allows derived classes to lazyly self-initialize. Implementations that support lazy-initialization should override
/// Allows derived classes to lazily self-initialize. Implementations that support lazy-initialization should override
/// this method and call <see cref="Initialize(string, string)" />.
/// </summary>
protected virtual void EnsureInitialized()

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree
public enum RenderTreeFrameType: short
{
/// <summary>
/// Used only for unintialized frames.
/// Used only for uninitialized frames.
/// </summary>
None = 0,

View File

@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree
// remaining work.
// During the synchronous rendering process we don't wait for the pending asynchronous
// work to finish as it will simply trigger new renders that will be handled afterwards.
// During the asynchronous rendering process we want to wait up untill al components have
// During the asynchronous rendering process we want to wait up until all components have
// finished rendering so that we can produce the complete output.
var componentState = GetRequiredComponentState(componentId);
componentState.SetDirectParameters(initialParameters);
@ -388,7 +388,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree
: null;
/// <summary>
/// Processses pending renders requests from components if there are any.
/// Processes pending renders requests from components if there are any.
/// </summary>
protected virtual void ProcessPendingRender()
{

View File

@ -242,7 +242,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
AssertCanAddAttribute();
if (_lastNonAttributeFrameType == RenderTreeFrameType.Component)
{
// Since this is a component, we need to preserve the type of the EventCallabck, so we have
// Since this is a component, we need to preserve the type of the EventCallback, so we have
// to box.
Append(RenderTreeFrame.Attribute(sequence, name, (object)value));
}

View File

@ -147,20 +147,20 @@ namespace Microsoft.AspNetCore.Components.Rendering
// synchronously runs the callback
public override void Send(SendOrPostCallback d, object state)
{
Task antecedant;
Task antecedent;
var completion = new TaskCompletionSource<object>();
lock (_state.Lock)
{
antecedant = _state.Task;
antecedent = _state.Task;
_state.Task = completion.Task;
}
// We have to block. That's the contract of Send - we don't expect this to be used
// in many scenarios in Components.
//
// Using Wait here is ok because the antecedant task will never throw.
antecedant.Wait();
// Using Wait here is ok because the antecedent task will never throw.
antecedent.Wait();
ExecuteSynchronously(completion, d, state);
}
@ -195,7 +195,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
ExecuteSynchronously(completion, d, state);
}
private Task Enqueue(Task antecedant, SendOrPostCallback d, object state, bool forceAsync = false)
private Task Enqueue(Task antecedent, SendOrPostCallback d, object state, bool forceAsync = false)
{
// If we get here is means that a callback is being explicitly queued. Let's instead add it to the queue and yield.
//
@ -212,7 +212,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
}
var flags = forceAsync ? TaskContinuationOptions.RunContinuationsAsynchronously : TaskContinuationOptions.None;
return antecedant.ContinueWith(BackgroundWorkThunk, new WorkItem()
return antecedent.ContinueWith(BackgroundWorkThunk, new WorkItem()
{
SynchronizationContext = this,
ExecutionContext = executionContext,

View File

@ -222,7 +222,7 @@ namespace Microsoft.AspNetCore.Components.Test
// Act/Assert 2: Re-render the CascadingValue; observe nested component wasn't re-rendered
providedValue = "Updated value";
displayNestedComponent = false; // Remove the nested componet
displayNestedComponent = false; // Remove the nested component
component.TriggerRender();
// Assert: We did not render the nested component now it's been removed

View File

@ -366,7 +366,7 @@ namespace Microsoft.AspNetCore.Components
public void HasDuplicateCaptureUnmatchedValuesParameters_Throws()
{
// Arrange
var target = new HasDupliateCaptureUnmatchedValuesProperty();
var target = new HasDuplicateCaptureUnmatchedValuesProperty();
var parameters = new ParameterViewBuilder().Build();
// Act
@ -374,17 +374,17 @@ namespace Microsoft.AspNetCore.Components
// Assert
Assert.Equal(
$"Multiple properties were found on component type '{typeof(HasDupliateCaptureUnmatchedValuesProperty).FullName}' " +
$"Multiple properties were found on component type '{typeof(HasDuplicateCaptureUnmatchedValuesProperty).FullName}' " +
$"with '{nameof(ParameterAttribute)}.{nameof(ParameterAttribute.CaptureUnmatchedValues)}'. " +
$"Only a single property per type can use '{nameof(ParameterAttribute)}.{nameof(ParameterAttribute.CaptureUnmatchedValues)}'. " +
$"Properties:" + Environment.NewLine +
$"{nameof(HasDupliateCaptureUnmatchedValuesProperty.CaptureUnmatchedValuesProp1)}" + Environment.NewLine +
$"{nameof(HasDupliateCaptureUnmatchedValuesProperty.CaptureUnmatchedValuesProp2)}",
$"{nameof(HasDuplicateCaptureUnmatchedValuesProperty.CaptureUnmatchedValuesProp1)}" + Environment.NewLine +
$"{nameof(HasDuplicateCaptureUnmatchedValuesProperty.CaptureUnmatchedValuesProp2)}",
ex.Message);
}
[Fact]
public void HasCaptureUnmatchedValuesParameteterWithWrongType_Throws()
public void HasCaptureUnmatchedValuesParameterWithWrongType_Throws()
{
// Arrange
var target = new HasWrongTypeCaptureUnmatchedValuesProperty();
@ -630,7 +630,7 @@ namespace Microsoft.AspNetCore.Components
[Parameter(CaptureUnmatchedValues = true)] public IReadOnlyDictionary<string, object> CaptureUnmatchedValues { get; set; }
}
class HasDupliateCaptureUnmatchedValuesProperty
class HasDuplicateCaptureUnmatchedValuesProperty
{
[Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object> CaptureUnmatchedValuesProp1 { get; set; }
[Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> CaptureUnmatchedValuesProp2 { get; set; }

View File

@ -442,7 +442,7 @@ namespace Microsoft.AspNetCore.Components.Test
[Fact]
public void HandlesKeyBeingAdded()
{
// This is an anomolous situation that can't occur with .razor components.
// This is an anomalous situation that can't occur with .razor components.
// It represents the case where, for the same sequence number, we have an
// old frame without a key and a new frame with a key.
@ -472,7 +472,7 @@ namespace Microsoft.AspNetCore.Components.Test
[Fact]
public void HandlesKeyBeingRemoved()
{
// This is an anomolous situation that can't occur with .razor components.
// This is an anomalous situation that can't occur with .razor components.
// It represents the case where, for the same sequence number, we have an
// old frame with a key and a new frame without a key.

View File

@ -3574,7 +3574,7 @@ namespace Microsoft.AspNetCore.Components.Test
// Act &A Assert
renderer.Dispose();
// All components must be disposed even if some throw as part of being diposed.
// All components must be disposed even if some throw as part of being disposed.
Assert.True(component.Disposed);
var aex = Assert.IsType<AggregateException>(Assert.Single(renderer.HandledExceptions));
Assert.Contains(exception1, aex.InnerExceptions);

View File

@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
}
[Fact]
public void Post_RunsAynchronously_WhenNotBusy_Exception()
public void Post_RunsAsynchronously_WhenNotBusy_Exception()
{
// Arrange
var context = new RendererSynchronizationContext();

View File

@ -9,7 +9,7 @@ using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Components.Server
{
// We use a middlware so that we can use DI.
// We use a middleware so that we can use DI.
internal class CircuitDisconnectMiddleware
{
private const string CircuitIdKey = "circuitId";

View File

@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Components.Server
/// without losing any state in the event of transient connection issues.
/// </para>
/// <para>
/// This value determines the maximium number of circuit states retained by the server.
/// This value determines the maximum number of circuit states retained by the server.
/// <seealso cref="DisconnectedCircuitRetentionPeriod"/>
/// </para>
/// </summary>
@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Components.Server
/// without losing any state in the event of transient connection issues.
/// </para>
/// <para>
/// This value determines the maximium duration circuit state is retained by the server before being evicted.
/// This value determines the maximum duration circuit state is retained by the server before being evicted.
/// <seealso cref="DisconnectedCircuitMaxRetained"/>
/// </para>
/// </summary>

View File

@ -355,7 +355,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
// EndInvokeJSFromDotNet is used in a fire-and-forget context, so it's responsible for its own
// error handling.
public async Task EndInvokeJSFromDotNet(long asyncCall, bool succeded, string arguments)
public async Task EndInvokeJSFromDotNet(long asyncCall, bool succeeded, string arguments)
{
AssertInitialized();
AssertNotDisposed();
@ -364,7 +364,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
{
await Renderer.Dispatcher.InvokeAsync(() =>
{
if (!succeded)
if (!succeeded)
{
// We can log the arguments here because it is simply the JS error with the call stack.
Log.EndInvokeJSFailed(_logger, asyncCall, arguments);
@ -577,11 +577,11 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
private static class Log
{
private static readonly Action<ILogger, Exception> _intializationStarted;
private static readonly Action<ILogger, Exception> _intializationSucceded;
private static readonly Action<ILogger, Exception> _intializationFailed;
private static readonly Action<ILogger, Exception> _initializationStarted;
private static readonly Action<ILogger, Exception> _initializationSucceded;
private static readonly Action<ILogger, Exception> _initializationFailed;
private static readonly Action<ILogger, CircuitId, Exception> _disposeStarted;
private static readonly Action<ILogger, CircuitId, Exception> _disposeSucceded;
private static readonly Action<ILogger, CircuitId, Exception> _disposeSucceeded;
private static readonly Action<ILogger, CircuitId, Exception> _disposeFailed;
private static readonly Action<ILogger, CircuitId, Exception> _onCircuitOpened;
private static readonly Action<ILogger, CircuitId, string, Exception> _onConnectionUp;
@ -639,7 +639,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
public static readonly EventId EndInvokeJSSucceeded = new EventId(206, "EndInvokeJSSucceeded");
public static readonly EventId DispatchEventThroughJSInterop = new EventId(207, "DispatchEventThroughJSInterop");
public static readonly EventId LocationChange = new EventId(208, "LocationChange");
public static readonly EventId LocationChangeSucceded = new EventId(209, "LocationChangeSucceeded");
public static readonly EventId LocationChangeSucceeded = new EventId(209, "LocationChangeSucceeded");
public static readonly EventId LocationChangeFailed = new EventId(210, "LocationChangeFailed");
public static readonly EventId LocationChangeFailedInCircuit = new EventId(211, "LocationChangeFailedInCircuit");
public static readonly EventId OnRenderCompletedFailed = new EventId(212, "OnRenderCompletedFailed");
@ -647,17 +647,17 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
static Log()
{
_intializationStarted = LoggerMessage.Define(
_initializationStarted = LoggerMessage.Define(
LogLevel.Debug,
EventIds.InitializationStarted,
"Circuit initialization started.");
_intializationSucceded = LoggerMessage.Define(
_initializationSucceded = LoggerMessage.Define(
LogLevel.Debug,
EventIds.InitializationSucceeded,
"Circuit initialization succeeded.");
_intializationFailed = LoggerMessage.Define(
_initializationFailed = LoggerMessage.Define(
LogLevel.Debug,
EventIds.InitializationFailed,
"Circuit initialization failed.");
@ -667,10 +667,10 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
EventIds.DisposeStarted,
"Disposing circuit '{CircuitId}' started.");
_disposeSucceded = LoggerMessage.Define<CircuitId>(
_disposeSucceeded = LoggerMessage.Define<CircuitId>(
LogLevel.Debug,
EventIds.DisposeSucceeded,
"Disposing circuit '{CircuitId}' succeded.");
"Disposing circuit '{CircuitId}' succeeded.");
_disposeFailed = LoggerMessage.Define<CircuitId>(
LogLevel.Debug,
@ -725,7 +725,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
_unhandledExceptionClientDisconnected = LoggerMessage.Define<CircuitId>(
LogLevel.Debug,
EventIds.UnhandledExceptionClientDisconnected,
"An exception ocurred on the circuit host '{CircuitId}' while the client is disconnected.");
"An exception occurred on the circuit host '{CircuitId}' while the client is disconnected.");
_beginInvokeDotNetStatic = LoggerMessage.Define<string, string, string>(
LogLevel.Debug,
@ -779,8 +779,8 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
_locationChangeSucceeded = LoggerMessage.Define<string, CircuitId>(
LogLevel.Debug,
EventIds.LocationChangeSucceded,
"Location change to '{URI}' in circuit '{CircuitId}' succeded.");
EventIds.LocationChangeSucceeded,
"Location change to '{URI}' in circuit '{CircuitId}' succeeded.");
_locationChangeFailed = LoggerMessage.Define<string, CircuitId>(
LogLevel.Debug,
@ -798,11 +798,11 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
"Failed to complete render batch '{RenderId}' in circuit host '{CircuitId}'.");
}
public static void InitializationStarted(ILogger logger) => _intializationStarted(logger, null);
public static void InitializationSucceeded(ILogger logger) => _intializationSucceded(logger, null);
public static void InitializationFailed(ILogger logger, Exception exception) => _intializationFailed(logger, exception);
public static void InitializationStarted(ILogger logger) => _initializationStarted(logger, null);
public static void InitializationSucceeded(ILogger logger) => _initializationSucceded(logger, null);
public static void InitializationFailed(ILogger logger, Exception exception) => _initializationFailed(logger, exception);
public static void DisposeStarted(ILogger logger, CircuitId circuitId) => _disposeStarted(logger, circuitId, null);
public static void DisposeSucceeded(ILogger logger, CircuitId circuitId) => _disposeSucceded(logger, circuitId, null);
public static void DisposeSucceeded(ILogger logger, CircuitId circuitId) => _disposeSucceeded(logger, circuitId, null);
public static void DisposeFailed(ILogger logger, CircuitId circuitId, Exception exception) => _disposeFailed(logger, circuitId, exception);
public static void CircuitOpened(ILogger logger, CircuitId circuitId) => _onCircuitOpened(logger, circuitId, null);
public static void ConnectionUp(ILogger logger, CircuitId circuitId, string connectionId) => _onConnectionUp(logger, circuitId, connectionId, null);

View File

@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
/// the <see cref="CircuitClientProxy"/> to use the new client instance that attempted to reconnect to the server. Removing the entry from
/// <see cref="DisconnectedCircuits"/> should ensure we no longer have to concern ourselves with entry expiration.
///
/// Knowing when a client disconnected is not an exact science. There's a fair possiblity that a client may reconnect before the server realizes.
/// Knowing when a client disconnected is not an exact science. There's a fair possibility that a client may reconnect before the server realizes.
/// 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>
@ -99,7 +99,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
else
{
// DisconnectCore may fail to disconnect the circuit if it was previously marked inactive or
// has been transfered to a new connection. Do not invoke the circuit handlers in this instance.
// has been transferred to a new connection. Do not invoke the circuit handlers in this instance.
// We have to do in this instance.
return Task.CompletedTask;
@ -181,7 +181,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
{
// Transition the host from disconnected to connected if it's available. In this critical section, we return
// an existing host if it's currently considered connected or transition a disconnected host to connected.
// Transfering also wires up the client to the new set.
// Transferring also wires up the client to the new set.
(circuitHost, previouslyConnected) = ConnectCore(circuitId, clientProxy, connectionId);
if (circuitHost == null)
@ -428,7 +428,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
_connectingToDisconnectedCircuit = LoggerMessage.Define<CircuitId, string>(
LogLevel.Debug,
EventIds.ConnectingToDisconnectedCircuit,
"Transfering disconnected circuit {CircuitId} to connection {ConnectionId}.");
"Transferring disconnected circuit {CircuitId} to connection {ConnectionId}.");
_failedToReconnectToCircuit = LoggerMessage.Define<CircuitId>(
LogLevel.Debug,

View File

@ -72,14 +72,14 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
// as we have a client that is not acknowledging render batches fast enough (something we consider needs
// to be fast).
// The result is something as follows:
// Lets imagine an extreme case where the server produces a new batch every milisecond.
// Lets say the client is able to ACK a batch every 100 miliseconds.
// Lets imagine an extreme case where the server produces a new batch every millisecond.
// Lets say the client is able to ACK a batch every 100 milliseconds.
// When the app starts the client might see the sequence 0->(MaxUnacknowledgedRenderBatches-1) and then
// after 100 miliseconds it sees it jump to 1xx, then to 2xx where xx is something between {0..99} the
// after 100 milliseconds it sees it jump to 1xx, then to 2xx where xx is something between {0..99} the
// reason for this is that the server slows down rendering new batches to as fast as the client can consume
// them.
// Similarly, if a client were to send events at a faster pace than the server can consume them, the server
// would still proces the events, but would not produce new renders until it gets an ack that frees up space
// would still process the events, but would not produce new renders until it gets an ack that frees up space
// for a new render.
// We should never see UnacknowledgedRenderBatches.Count > _options.MaxBufferedUnacknowledgedRenderBatches
@ -184,7 +184,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
{
// Send the render batch to the client
// If the "send" operation fails (synchronously or asynchronously) or the client
// gets disconected simply give up. This likely means that
// gets disconnected simply give up. This likely means that
// the circuit went offline while sending the data, so simply wait until the
// client reconnects back or the circuit gets evicted because it stayed
// disconnected for too long.
@ -229,7 +229,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
// from the client that it has received and successfully applied all batches up to that point).
// If receive an ack for a previously acknowledged batch, its an error, as the messages are
// guranteed to be delivered in order, so a message for a render batch of 2 will never arrive
// guaranteed to be delivered in order, so a message for a render batch of 2 will never arrive
// after a message for a render batch for 3.
// If that were to be the case, it would just be enough to relax the checks here and simply skip
// the message.
@ -264,7 +264,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
if (lastBatchId < incomingBatchId)
{
// This exception is due to a bad client input, so we mark it as such to prevent loging it as a warning and
// This exception is due to a bad client input, so we mark it as such to prevent logging it as a warning and
// flooding the logs with warnings.
throw new InvalidOperationException($"Received an acknowledgement for batch with id '{incomingBatchId}' when the last batch produced was '{lastBatchId}'.");
}

View File

@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
}
[Fact]
public void CreateCircuitId_Generates_GeneratesDifferentIds_ForSuccesiveCalls()
public void CreateCircuitId_Generates_GeneratesDifferentIds_ForSuccessiveCalls()
{
// Arrange
var factory = TestCircuitIdFactory.CreateTestFactory();

View File

@ -179,7 +179,7 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
// Assert
Assert.Equal(new long[] { 2, 3, 4 }, renderIds);
Assert.True(task.Wait(3000), "One or more render batches werent acknowledged");
Assert.True(task.Wait(3000), "One or more render batches weren't acknowledged");
await task;
}
@ -233,7 +233,7 @@ namespace Microsoft.AspNetCore.Components.Web.Rendering
exceptions.Add(e);
};
// Receive the ack for the intial batch
// Receive the ack for the initial batch
_ = renderer.OnRenderCompletedAsync(2, null);
// Receive the ack for the second batch
_ = renderer.OnRenderCompletedAsync(3, null);

View File

@ -66,9 +66,9 @@ namespace Microsoft.AspNetCore.Components.Server.Tests
services.AddServerSideBlazor();
services.AddSingleton<IConfiguration>(new ConfigurationBuilder().Build());
var serviceProvder = services.BuildServiceProvider();
var serviceProvider = services.BuildServiceProvider();
return new ApplicationBuilder(serviceProvder);
return new ApplicationBuilder(serviceProvider);
}
private class MyComponent : IComponent

View File

@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Components
}
else
{
throw new JsonException($"Unexcepted JSON Token {reader.TokenType}.");
throw new JsonException($"Unexpected JSON Token {reader.TokenType}.");
}
}
@ -49,4 +49,4 @@ namespace Microsoft.AspNetCore.Components
writer.WriteEndObject();
}
}
}
}

View File

@ -122,7 +122,7 @@ namespace Microsoft.AspNetCore.Components.Forms
}
/// <summary>
/// Formats the value as a string. Derived classes can override this to determine the formating used for <see cref="CurrentValueAsString"/>.
/// Formats the value as a string. Derived classes can override this to determine the formatting used for <see cref="CurrentValueAsString"/>.
/// </summary>
/// <param name="value">The value to format.</param>
/// <returns>A string representation of the value.</returns>

View File

@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.Components.Forms
}
/// <summary>
/// Formats the value as a string. Derived classes can override this to determine the formating used for <c>CurrentValueAsString</c>.
/// Formats the value as a string. Derived classes can override this to determine the formatting used for <c>CurrentValueAsString</c>.
/// </summary>
/// <param name="value">The value to format.</param>
/// <returns>A string representation of the value.</returns>

View File

@ -212,7 +212,7 @@ namespace Microsoft.AspNetCore.Components.Forms
};
var fieldIdentifier = FieldIdentifier.Create(() => model.StringProperty);
// Act/Assert: Initally, it's valid and unmodified
// Act/Assert: Initially, it's valid and unmodified
var inputComponent = await RenderAndGetTestInputComponentAsync(rootComponent);
Assert.Equal("valid", inputComponent.CssClass); // no Class was specified

View File

@ -38,7 +38,7 @@ namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests
[Theory]
[InlineData("en-US")]
[InlineData("fr-FR")]
public void CanSetCultureAndParseCultueSensitiveNumbersAndDates(string culture)
public void CanSetCultureAndParseCultureSensitiveNumbersAndDates(string culture)
{
var cultureInfo = CultureInfo.GetCultureInfo(culture);

View File

@ -18,7 +18,7 @@
<p id="errormessage-failure">Error = @errorFailure</p>
<button id="triggerjsinterop-malformed" @onclick="@TriggerJSInterop">Trigger malformed JS interop callback</button>
<button id="triggerjsinterop-success" @onclick="@TriggerJSInteropSuccess">Trigger successfull JS interop callback</button>
<button id="triggerjsinterop-success" @onclick="@TriggerJSInteropSuccess">Trigger successful JS interop callback</button>
<button id="triggerjsinterop-failure" @onclick="@TriggerJSInteropFailure">Trigger error JS interop callback</button>
<button id="event-handler-throw-sync" @onclick="@TriggerSyncException">Trigger sync exception</button>

View File

@ -118,7 +118,7 @@ namespace Microsoft.AspNetCore.E2ETesting
// To prevent this we let the client attempt several times to connect to the server, increasing
// the max allowed timeout for a command on each attempt linearly.
// This can also be caused if many tests are running concurrently, we might want to manage
// chrome and chromedriver instances more aggresively if we have to.
// chrome and chromedriver instances more aggressively if we have to.
// Additionally, if we think the selenium server has become irresponsive, we could spin up
// replace the current selenium server instance and let a new instance take over for the
// remaining tests.

View File

@ -191,7 +191,7 @@ Captured output lines:
private static Process StartSentinelProcess(Process process, string sentinelFile, int timeout)
{
// This sentinel process will start and will kill any roge selenium server that want' torn down
// This sentinel process will start and will kill any rouge selenium server that want' torn down
// via normal means.
var psi = new ProcessStartInfo
{