File: Generated\361d1da7f942c932\CascadingAuthenticationState_razor.decl.g.cs
Web Access
Project: ..\..\..\src\aspnetcore\src\Components\Authorization\src\Microsoft.AspNetCore.Components.Authorization.csproj (Microsoft.AspNetCore.Components.Authorization)
// <auto-generated/>
#pragma warning disable 1591
namespace Microsoft.AspNetCore.Components.Authorization
{
    #line default
    using global::System;
    using global::System.Collections.Generic;
    using global::System.Linq;
    using global::System.Threading.Tasks;
    using global::Microsoft.AspNetCore.Components;
    #line default
    #line hidden
    #nullable restore
    public partial class CascadingAuthenticationState : global::Microsoft.AspNetCore.Components.ComponentBase, 
#nullable restore
#line (1,13)-(1,24) "D:\a\_work\1\s\src\aspnetcore\src\Components\Authorization\src\CascadingAuthenticationState.razor"
IDisposable
 
#line default
#line hidden
#nullable disable
 
    #nullable disable
    {
#nullable restore
#line (6,8)-(36,1) "D:\a\_work\1\s\src\aspnetcore\src\Components\Authorization\src\CascadingAuthenticationState.razor"
 
    private Task<AuthenticationState>? _currentAuthenticationStateTask;
 
    /// <summary>
    /// The content to which the authentication state should be provided.
    /// </summary>
    [Parameter]
    public RenderFragment? ChildContent { get; set; }
 
    protected override void OnInitialized()
    {
        AuthenticationStateProvider.AuthenticationStateChanged += OnAuthenticationStateChanged;
 
        _currentAuthenticationStateTask = AuthenticationStateProvider
            .GetAuthenticationStateAsync();
    }
 
    private void OnAuthenticationStateChanged(Task<AuthenticationState> newAuthStateTask)
    {
        _ = InvokeAsync(() =>
        {
            _currentAuthenticationStateTask = newAuthStateTask;
            StateHasChanged();
        });
    }
 
    void IDisposable.Dispose()
    {
        AuthenticationStateProvider.AuthenticationStateChanged -= OnAuthenticationStateChanged;
    }
 
#line default
#line hidden
#nullable disable
 
        [global::Microsoft.AspNetCore.Components.InjectAttribute] private 
#nullable restore
#line (2,9)-(2,36) "D:\a\_work\1\s\src\aspnetcore\src\Components\Authorization\src\CascadingAuthenticationState.razor"
AuthenticationStateProvider
 
#line default
#line hidden
#nullable disable
         
#nullable restore
#line (2,37)-(2,64) "D:\a\_work\1\s\src\aspnetcore\src\Components\Authorization\src\CascadingAuthenticationState.razor"
AuthenticationStateProvider
 
#line default
#line hidden
#nullable disable
         { get; set; }
         = default!;
    }
}
#pragma warning restore 1591