mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1006 B
37 lines
1006 B
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
using Volo.ClientSimulation.Snapshot;
|
|
|
|
namespace Volo.ClientSimulation.Pages.ClientSimulation
|
|
{
|
|
public class SimulationAreaModel : PageModel
|
|
{
|
|
public SimulationSnapshot Snapshot { get; private set; }
|
|
|
|
protected Simulation Simulation { get; }
|
|
|
|
public SimulationAreaModel(Simulation simulation)
|
|
{
|
|
Simulation = simulation;
|
|
}
|
|
|
|
public virtual Task<IActionResult> OnGetAsync()
|
|
{
|
|
Snapshot = Simulation.CreateSnapshot();
|
|
return Task.FromResult<IActionResult>(Page());
|
|
}
|
|
|
|
public virtual async Task<IActionResult> OnPostStartAsync()
|
|
{
|
|
Simulation.Start();
|
|
return new NoContentResult();
|
|
}
|
|
|
|
public virtual async Task<IActionResult> OnPostStopAsync()
|
|
{
|
|
Simulation.Stop();
|
|
return new NoContentResult();
|
|
}
|
|
}
|
|
}
|