Skip to content

Commit 58b6895

Browse files
committed
Cleanup.
1 parent 580b8be commit 58b6895

File tree

8 files changed

+17
-65
lines changed

8 files changed

+17
-65
lines changed

src/Components/Components/src/NavigationManager.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public event EventHandler<LocationChangedEventArgs> LocationChanged
3838
/// <summary>
3939
/// An event that fires when the page is not found.
4040
/// </summary>
41-
public event EventHandler<NotFoundEventArgs> NotFoundEvent
41+
public event EventHandler<EventArgs> NotFoundEvent
4242
{
4343
add
4444
{
@@ -52,7 +52,7 @@ public event EventHandler<NotFoundEventArgs> NotFoundEvent
5252
}
5353
}
5454

55-
private EventHandler<NotFoundEventArgs>? _notFound;
55+
private EventHandler<EventArgs>? _notFound;
5656

5757
private readonly List<Func<NotFoundContext, ValueTask>> _notFoundHandlers = new();
5858

@@ -201,12 +201,12 @@ public virtual void Refresh(bool forceReload = false)
201201
=> NavigateTo(Uri, forceLoad: true, replace: true);
202202

203203
/// <summary>
204-
/// TODO
204+
/// Handles setting the NotFound state.
205205
/// </summary>
206206
public virtual void NotFound() => NotFoundCore();
207207

208208
/// <summary>
209-
/// TODO
209+
/// Handles setting the NotFound state.
210210
/// </summary>
211211
protected virtual void NotFoundCore() => throw new NotImplementedException();
212212

@@ -344,16 +344,11 @@ protected void NotifyLocationChanged(bool isInterceptedLink)
344344
/// <summary>
345345
/// Triggers the <see cref="NotFound"/> event with the current URI value.
346346
/// </summary>
347-
protected void NotifyNotFound(bool isInterceptedLink)
347+
protected void NotifyNotFound()
348348
{
349349
try
350350
{
351-
_notFound?.Invoke(
352-
this,
353-
new NotFoundEventArgs(isInterceptedLink)
354-
{
355-
HistoryEntryState = HistoryEntryState
356-
});
351+
_notFound?.Invoke(this, new EventArgs());
357352
}
358353
catch (Exception ex)
359354
{
@@ -486,7 +481,7 @@ protected async ValueTask<bool> NotifyLocationChangingAsync(string uri, string?
486481
cts.Dispose();
487482

488483
if (_locationChangingCts == cts)
489-
{
484+
{
490485
_locationChangingCts = null;
491486
}
492487
}
@@ -495,9 +490,8 @@ protected async ValueTask<bool> NotifyLocationChangingAsync(string uri, string?
495490
/// <summary>
496491
/// Notifies the registered handlers of the current ot found event.
497492
/// </summary>
498-
/// <param name="isNavigationIntercepted">Whether this not found was intercepted from a link.</param>
499493
/// <returns>A <see cref="ValueTask{TResult}"/> representing the completion of the operation. If the result is <see langword="true"/>, the navigation should continue.</returns>
500-
protected async ValueTask<bool> NotifyNotFoundAsync(bool isNavigationIntercepted)
494+
protected async ValueTask<bool> NotifyNotFoundAsync()
501495
{
502496
_notFoundCts?.Cancel();
503497
_notFoundCts = null;
@@ -516,8 +510,6 @@ protected async ValueTask<bool> NotifyNotFoundAsync(bool isNavigationIntercepted
516510
var cancellationToken = cts.Token;
517511
var context = new NotFoundContext
518512
{
519-
// HistoryEntryState = state,
520-
IsNavigationIntercepted = isNavigationIntercepted,
521513
CancellationToken = cancellationToken,
522514
};
523515

src/Components/Components/src/PublicAPI.Unshipped.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22

33
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFound() -> void
44
virtual Microsoft.AspNetCore.Components.NavigationManager.NotFoundCore() -> void
5-
Microsoft.AspNetCore.Components.NavigationManager.NotFoundEvent -> System.EventHandler<Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs!>!
6-
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs
7-
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.NotFoundEventArgs(bool isNavigationIntercepted) -> void
8-
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.IsNavigationIntercepted.get -> bool
9-
Microsoft.AspNetCore.Components.Routing.NotFoundEventArgs.HistoryEntryState.get -> string?
5+
Microsoft.AspNetCore.Components.NavigationManager.NotFoundEvent -> System.EventHandler<System.EventArgs!>!
106
Microsoft.AspNetCore.Components.Routing.NotFoundContext
117
Microsoft.AspNetCore.Components.Routing.NotFoundContext.NotFoundContext() -> void
128
Microsoft.AspNetCore.Components.Routing.NotFoundContext.CancellationToken.get -> System.Threading.CancellationToken
139
Microsoft.AspNetCore.Components.Routing.NotFoundContext.CancellationToken.init -> void
14-
Microsoft.AspNetCore.Components.Routing.NotFoundContext.IsNavigationIntercepted.get -> bool
15-
Microsoft.AspNetCore.Components.Routing.NotFoundContext.IsNavigationIntercepted.init -> void
1610
Microsoft.AspNetCore.Components.Routing.NotFoundContext.PreventRendering() -> void
17-
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFound(bool isInterceptedLink) -> void
18-
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFoundAsync(bool isNavigationIntercepted) -> System.Threading.Tasks.ValueTask<bool>
11+
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFound() -> void
12+
Microsoft.AspNetCore.Components.NavigationManager.NotifyNotFoundAsync() -> System.Threading.Tasks.ValueTask<bool>
1913
virtual Microsoft.AspNetCore.Components.NavigationManager.HandleNotFoundHandlerException(System.Exception! ex, Microsoft.AspNetCore.Components.Routing.NotFoundContext! context) -> void
2014
Microsoft.AspNetCore.Components.NotFoundRenderingException
2115
Microsoft.AspNetCore.Components.NotFoundRenderingException.NotFoundRenderingException(string! message, System.Exception! innerException) -> void

src/Components/Components/src/Routing/NotFoundContext.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ public sealed class NotFoundContext
1616
/// </summary>
1717
public CancellationToken CancellationToken { get; init; }
1818

19-
/// <summary>
20-
/// Gets whether this navigation was intercepted from a link.
21-
/// </summary>
22-
public bool IsNavigationIntercepted { get; init; }
23-
2419
/// <summary>
2520
/// Prevents this navigation from continuing.
2621
/// </summary>

src/Components/Components/src/Routing/NotFoundEventArgs.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Components/Components/src/Routing/Router.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ private void OnLocationChanged(object sender, LocationChangedEventArgs args)
322322
}
323323
}
324324

325-
private void OnNotFound(object sender, NotFoundEventArgs args)
325+
private void OnNotFound(object sender, EventArgs args)
326326
{
327327
if (_renderHandle.IsInitialized)
328328
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#nullable enable
1+
#nullable enable

src/Components/Server/src/Circuits/RemoteNavigationManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ async Task NotFoundAsync()
160160
{
161161
try
162162
{
163-
bool shouldContinueRendering = await NotifyNotFoundAsync(false);
163+
bool shouldContinueRendering = await NotifyNotFoundAsync();
164164
if (!shouldContinueRendering)
165165
{
166166
Log.NotFoundRenderCanceled(_logger);
167167
return;
168168
}
169169

170-
NotifyNotFound(false);
170+
NotifyNotFound();
171171
}
172172
catch (Exception ex)
173173
{

src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyNavigationManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ async Task PerformNotFoundAsync()
9494
{
9595
try
9696
{
97-
var shouldContinueNotFound = await NotifyNotFoundAsync(false); // should we pass NavigationOptions.HistoryEntryState? are we navigating awaay and changing the history?
97+
var shouldContinueNotFound = await NotifyNotFoundAsync();
9898

9999
if (!shouldContinueNotFound)
100100
{
101101
Log.NotFoundRenderCanceled(_logger);
102102
return;
103103
}
104104

105-
NotifyNotFound(false);
105+
NotifyNotFound();
106106
}
107107
catch (Exception ex)
108108
{

0 commit comments

Comments
 (0)