CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ActiveCircuitHandler.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ActiveCircuitHandler.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Circuit handler indicating if code in server-side Blazor</summary>
7//-----------------------------------------------------------------------
8#if NET5_0_OR_GREATER
9using System.Threading;
10using System.Threading.Tasks;
11using Microsoft.AspNetCore.Components.Server.Circuits;
12
13namespace Csla.AspNetCore.Blazor
14{
18 public class ActiveCircuitHandler : CircuitHandler
19 {
24 public ActiveCircuitHandler(ActiveCircuitState activeCircuitState)
25 {
26 ActiveCircuitState = activeCircuitState;
27 }
28
29 private ActiveCircuitState ActiveCircuitState { get; set; }
30
36 public override Task OnCircuitOpenedAsync(Circuit circuit, CancellationToken cancellationToken)
37 {
38 ActiveCircuitState.CircuitExists = true;
39 return base.OnCircuitOpenedAsync(circuit, cancellationToken);
40 }
41 }
42}
43#endif