mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-21 06:48:11 -04:00
- Added Sandbox.Test.Unit project (contains independent tests that can run in parallel) - Modify some slow/stress tests (e.g. instead of doing a million iterations settle for 10k). Tests run almost twice as fast now.
89 lines
3.6 KiB
C#
89 lines
3.6 KiB
C#
#pragma checksum ".\StopwatchPanel.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "363a90f4352dc623de4a3c1b9fd880fc86302381"
|
|
// <auto-generated/>
|
|
#pragma warning disable 1591
|
|
#pragma warning disable 0162
|
|
namespace TestComponents
|
|
{
|
|
#line hidden
|
|
#line 2 ".\StopwatchPanel.razor"
|
|
using System.Diagnostics;
|
|
public partial class StopwatchPanel : global::Sandbox.UI.Panel
|
|
{
|
|
// Make sure everyone knows that we have a render tree
|
|
// (this is an optimization so we have a quick and definite way to check)
|
|
protected override string GetRenderTreeChecksum() => "363a90f4352dc623de4a3c1b9fd880fc86302381";
|
|
|
|
#pragma warning disable 1998
|
|
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
|
{
|
|
#line 4 ".\StopwatchPanel.razor"
|
|
for ( int i=0; i<10; i++)
|
|
{
|
|
__builder.AddLocation( ".\\StopwatchPanel.razor", 6, 4 );
|
|
__builder.OpenElement( 0, "div", null );
|
|
{
|
|
#line 6 ".\StopwatchPanel.razor"
|
|
__builder.AddAttribute(1, "style", "hello");
|
|
#line 7 ".\StopwatchPanel.razor"
|
|
for ( int j=0; j< 10; j++)
|
|
{
|
|
|
|
#line 9 ".\StopwatchPanel.razor"
|
|
__builder.AddContent(2, i);
|
|
__builder.AddContent( 3, " " );
|
|
__builder.AddLocation( ".\\StopwatchPanel.razor", 9, 11 );
|
|
__builder.OpenElement( 4, "div", null );
|
|
{
|
|
#line 9 ".\StopwatchPanel.razor"
|
|
__builder.AddAttribute(5, "style", "hello");
|
|
#line 9 ".\StopwatchPanel.razor"
|
|
__builder.AddAttribute( 6, "onclick", Stop );
|
|
__builder.AddContent( 7, "poop" );
|
|
}
|
|
__builder.CloseElement();
|
|
#line 10 ".\StopwatchPanel.razor"
|
|
}
|
|
}
|
|
__builder.CloseElement();
|
|
#line 11 ".\StopwatchPanel.razor"
|
|
}
|
|
__builder.AddLocation( ".\\StopwatchPanel.razor", 13, 0 );
|
|
__builder.OpenElement( 8, "div", null );
|
|
{
|
|
#line 13 ".\StopwatchPanel.razor"
|
|
__builder.AddAttribute(9, "class", "bigtext");
|
|
#line 13 ".\StopwatchPanel.razor"
|
|
__builder.AddAttribute( 10, "onclick", Stop );
|
|
__builder.AddLocation( ".\\StopwatchPanel.razor", 14, 4 );
|
|
__builder.OpenElement( 11, "div", null );
|
|
{
|
|
#line 14 ".\StopwatchPanel.razor"
|
|
__builder.AddAttribute(12, "class", "title" + " " + (Seconds < 5 ? "is-fucked" : "is-relax"));
|
|
__builder.AddContent( 13, "The time is " );
|
|
#line 14 ".\StopwatchPanel.razor"
|
|
__builder.AddContent(14, Formatted);
|
|
}
|
|
__builder.CloseElement();
|
|
__builder.AddLocation( ".\\StopwatchPanel.razor", 14, 93 );
|
|
__builder.AddMarkupContent( 15, "\r\n " );
|
|
__builder.AddLocation( ".\\StopwatchPanel.razor", 15, 4 );
|
|
__builder.AddMarkupContent( 16, "<div class=\"icon\"><i>time</i></div>" );
|
|
}
|
|
__builder.CloseElement();
|
|
}
|
|
#pragma warning restore 1998
|
|
#line 20 ".\StopwatchPanel.razor"
|
|
|
|
public string Formatted => sw.Elapsed.ToString();
|
|
public float Seconds => (float)sw.Elapsed.TotalSeconds;
|
|
Stopwatch sw = Stopwatch.StartNew();
|
|
|
|
public void Stop()
|
|
{
|
|
sw.Stop();
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 0162
|
|
#pragma warning restore 1591
|