File: _generated\0\CascadingAuthenticationState_razor.g.cs
Web Access
Project: src\src\aspnetcore\src\Components\Authorization\src\Microsoft.AspNetCore.Components.Authorization.csproj (Microsoft.AspNetCore.Components.Authorization)
#pragma checksum "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor" "{8829d00f-11b8-4213-878b-770e8597ac16}" "848eb142e2afd232184afce8a28f03c0c5f53f714db1a5963dc27071e25f3dbf"
// <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) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
IDisposable

#line default
#line hidden
#nullable disable

    #nullable disable
    {
        #pragma warning disable 1998
        protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
        {
            __builder.OpenComponent<global::Microsoft.AspNetCore.Components.CascadingValue<
#nullable restore
#line (4,25)-(4,73) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
System.Threading.Tasks.Task<AuthenticationState>

#line default
#line hidden
#nullable disable
            >>(0);
            __builder.AddComponentParameter(1, nameof(global::Microsoft.AspNetCore.Components.CascadingValue<System.Threading.Tasks.Task<AuthenticationState>>.
#nullable restore
#line (4,75)-(4,80) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
Value

#line default
#line hidden
#nullable disable
            ), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<System.Threading.Tasks.Task<AuthenticationState>>(
#nullable restore
#line (4,83)-(4,114) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
_currentAuthenticationStateTask

#line default
#line hidden
#nullable disable
            ));
            __builder.AddComponentParameter(2, nameof(global::Microsoft.AspNetCore.Components.CascadingValue<System.Threading.Tasks.Task<AuthenticationState>>.
#nullable restore
#line (4,116)-(4,128) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
ChildContent

#line default
#line hidden
#nullable disable
            ), (global::Microsoft.AspNetCore.Components.RenderFragment)(
#nullable restore
#line (4,131)-(4,143) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
ChildContent

#line default
#line hidden
#nullable disable
            ));
            __builder.CloseComponent();
        }
        #pragma warning restore 1998
#nullable restore
#line (6,8)-(36,1) "/__w/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) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
AuthenticationStateProvider

#line default
#line hidden
#nullable disable
         
#nullable restore
#line (2,37)-(2,64) "/__w/1/s/src/aspnetcore/src/Components/Authorization/src/CascadingAuthenticationState.razor"
AuthenticationStateProvider

#line default
#line hidden
#nullable disable
         { get; set; }
         = default!;
    }
}
#pragma warning restore 1591