-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from TimeWarpEngineering/Cramer/2024-03-03/Fe…
…atureNamespaces Change BlazorState.Features to TimeWarp.Features
- Loading branch information
Showing
41 changed files
with
173 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/Components/Counter.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...nsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.LoadAction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...-StateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter/CounterState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tateActionsHandlers/SampleDotNet8/SampleDotNet8.Client/Features/Counter2/Counter2State.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 78 additions & 78 deletions
156
Samples/01-StateActionsHandlers/SampleDotNet8/SampleDotNet8/Components/Pages/Weather.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
@page "/weather" | ||
@attribute [StreamRendering] | ||
|
||
<PageTitle>Weather</PageTitle> | ||
|
||
<h1>Weather</h1> | ||
|
||
<p>This component demonstrates showing data.</p> | ||
|
||
@if (System.OperatingSystem.IsBrowser()) | ||
{ | ||
<p>Render Mode: WebAssembly</p> | ||
} | ||
else | ||
{ | ||
<p>Render Mode: Server (Not Wasm)</p> | ||
} | ||
|
||
@if (forecasts == null) | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
else | ||
{ | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Temp. (C)</th> | ||
<th>Temp. (F)</th> | ||
<th>Summary</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var forecast in forecasts) | ||
{ | ||
<tr> | ||
<td>@forecast.Date.ToShortDateString()</td> | ||
<td>@forecast.TemperatureC</td> | ||
<td>@forecast.TemperatureF</td> | ||
<td>@forecast.Summary</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
} | ||
|
||
<BlazorState.Features.ReduxDevTools.Components.ReduxDevTools /> | ||
<BlazorState.Features.JavaScriptInterop.Components.TimeWarpJavaScriptInterop /> | ||
<BlazorState.Features.Routing.Components.TimeWarpNavigation /> | ||
|
||
|
||
@code { | ||
private WeatherForecast[]? forecasts; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
// Simulate asynchronous loading to demonstrate streaming rendering | ||
await Task.Delay(500); | ||
|
||
var startDate = DateOnly.FromDateTime(DateTime.Now); | ||
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; | ||
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
Date = startDate.AddDays(index), | ||
TemperatureC = Random.Shared.Next(-20, 55), | ||
Summary = summaries[Random.Shared.Next(summaries.Length)] | ||
}).ToArray(); | ||
} | ||
|
||
private class WeatherForecast | ||
{ | ||
public DateOnly Date { get; set; } | ||
public int TemperatureC { get; set; } | ||
public string? Summary { get; set; } | ||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
} | ||
} | ||
@page "/weather" | ||
@attribute [StreamRendering] | ||
|
||
<PageTitle>Weather</PageTitle> | ||
|
||
<h1>Weather</h1> | ||
|
||
<p>This component demonstrates showing data.</p> | ||
|
||
@if (System.OperatingSystem.IsBrowser()) | ||
{ | ||
<p>Render Mode: WebAssembly</p> | ||
} | ||
else | ||
{ | ||
<p>Render Mode: Server (Not Wasm)</p> | ||
} | ||
|
||
@if (forecasts == null) | ||
{ | ||
<p><em>Loading...</em></p> | ||
} | ||
else | ||
{ | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Temp. (C)</th> | ||
<th>Temp. (F)</th> | ||
<th>Summary</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var forecast in forecasts) | ||
{ | ||
<tr> | ||
<td>@forecast.Date.ToShortDateString()</td> | ||
<td>@forecast.TemperatureC</td> | ||
<td>@forecast.TemperatureF</td> | ||
<td>@forecast.Summary</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
} | ||
|
||
<TimeWarp.Features.ReduxDevTools.Components.ReduxDevTools /> | ||
<TimeWarp.Features.JavaScriptInterop.Components.TimeWarpJavaScriptInterop /> | ||
<TimeWarp.Features.Routing.Components.TimeWarpNavigation /> | ||
|
||
|
||
@code { | ||
private WeatherForecast[]? forecasts; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
// Simulate asynchronous loading to demonstrate streaming rendering | ||
await Task.Delay(500); | ||
|
||
var startDate = DateOnly.FromDateTime(DateTime.Now); | ||
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; | ||
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
Date = startDate.AddDays(index), | ||
TemperatureC = Random.Shared.Next(-20, 55), | ||
Summary = summaries[Random.Shared.Next(summaries.Length)] | ||
}).ToArray(); | ||
} | ||
|
||
private class WeatherForecast | ||
{ | ||
public DateOnly Date { get; set; } | ||
public int TemperatureC { get; set; } | ||
public string? Summary { get; set; } | ||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
Source/BlazorState/Features/Developer/Components/ReduxDevTools.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Source/BlazorState/Features/Developer/Components/RenderModeDisplay.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
Source/BlazorState/Features/JavaScriptInterop/Components/TimeWarpJavaScriptInterop.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
|
||
@using BlazorState.Features.JavaScriptInterop; | ||
@namespace TimeWarp.Features.JavaScriptInterop | ||
|
||
@code { | ||
|
||
|
Oops, something went wrong.