Skip to content

Commit 0e5c284

Browse files
committed
Rename methods to align with idiomatic C# method naming scheme
1 parent 9d5ddb0 commit 0e5c284

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

frameworks/keyed/blazor-wasm/src/App.razor

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
<div class="col-md-6">
1010
<div class="row">
1111
<div class="col-sm-6 smallpad">
12-
<button type='button' class='btn btn-primary btn-block' id='run' @onclick="run">Create 1,000 rows</button>
12+
<button type='button' class='btn btn-primary btn-block' id='run' @onclick="Run">Create 1,000 rows</button>
1313
</div>
1414
<div class="col-sm-6 smallpad">
15-
<button type='button' class='btn btn-primary btn-block' id='runlots' @onclick="runlots">Create 10,000 rows</button>
15+
<button type='button' class='btn btn-primary btn-block' id='runlots' @onclick="Runlots">Create 10,000 rows</button>
1616
</div>
1717
<div class="col-sm-6 smallpad">
18-
<button type='button' class='btn btn-primary btn-block' id='add' @onclick="add">Append 1,000 rows</button>
18+
<button type='button' class='btn btn-primary btn-block' id='add' @onclick="Add">Append 1,000 rows</button>
1919
</div>
2020
<div class="col-sm-6 smallpad">
21-
<button type='button' class='btn btn-primary btn-block' id='update' @onclick="update">Update every 10th row</button>
21+
<button type='button' class='btn btn-primary btn-block' id='update' @onclick="Update">Update every 10th row</button>
2222
</div>
2323
<div class="col-sm-6 smallpad">
24-
<button type='button' class='btn btn-primary btn-block' id='clear' @onclick="clear">Clear</button>
24+
<button type='button' class='btn btn-primary btn-block' id='clear' @onclick="Clear">Clear</button>
2525
</div>
2626
<div class="col-sm-6 smallpad">
27-
<button type='button' class='btn btn-primary btn-block' id='swaprows' @onclick="swaprows">Swap Rows</button>
27+
<button type='button' class='btn btn-primary btn-block' id='swaprows' @onclick="SwapRows">Swap Rows</button>
2828
</div>
2929
</div>
3030
</div>
@@ -37,12 +37,12 @@
3737
<tr @key="item.Id" class="@((item.Id == selected ? "danger" : ""))">
3838
<td class="col-md-1">@item.Id</td>
3939
<td class="col-md-4">
40-
<a href="#" @onclick="(_ => select(item))" @onclick:preventDefault>
40+
<a href="#" @onclick="(_ => Select(item))" @onclick:preventDefault>
4141
@item.Label
4242
</a>
4343
</td>
4444
<td class="col-md-1">
45-
<a href="#" @onclick="(_ => delete(item))" @onclick:preventDefault>
45+
<a href="#" @onclick="(_ => Delete(item))" @onclick:preventDefault>
4646
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
4747
</a>
4848
</td>

frameworks/keyed/blazor-wasm/src/App.razor.cs

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@ namespace blazor_wasm
66
{
77
public partial class App
88
{
9-
int startTime;
109
string lastMeasure;
1110
Stopwatch Stopwatch;
1211

13-
void startMeasure(string name)
12+
void StartMeasure(string name)
1413
{
1514
Stopwatch = Stopwatch.StartNew();
1615
lastMeasure = name;
1716
}
1817

19-
void stopMeasure()
18+
void StopMeasure()
2019
{
2120
Stopwatch.Stop();
2221
var last = this.lastMeasure ?? "";
@@ -48,7 +47,7 @@ void stopMeasure()
4847
"table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"
4948
};
5049

51-
List<Data> buildData(int count = 1000)
50+
List<Data> BuildData(int count = 1000)
5251
{
5352
var result = new List<Data>();
5453
for (int i = 0; i < count; i++)
@@ -63,50 +62,50 @@ List<Data> buildData(int count = 1000)
6362
return result;
6463
}
6564

66-
public void select(Data item)
65+
public void Select(Data item)
6766
{
68-
startMeasure("select");
67+
StartMeasure("select");
6968
this.selected = item.Id;
7069
}
7170

72-
void delete(Data item)
71+
void Delete(Data item)
7372
{
74-
startMeasure("delete");
73+
StartMeasure("delete");
7574
this.data.Remove(item);
7675
}
7776

78-
void run()
77+
void Run()
7978
{
80-
startMeasure("run");
81-
this.data = this.buildData();
79+
StartMeasure("run");
80+
this.data = this.BuildData();
8281
}
83-
void runlots()
82+
void Runlots()
8483
{
85-
startMeasure("runlots");
86-
this.data = this.buildData(10000);
84+
StartMeasure("runlots");
85+
this.data = this.BuildData(10000);
8786
}
88-
void add()
87+
void Add()
8988
{
90-
startMeasure("add");
91-
this.data.AddRange(this.buildData(1000));
89+
StartMeasure("add");
90+
this.data.AddRange(this.BuildData(1000));
9291
}
93-
void update()
92+
void Update()
9493
{
95-
startMeasure("update");
94+
StartMeasure("update");
9695
for (var i = 0; i < this.data.Count; i += 10)
9796
{
9897
this.data[i].Label += " !!!";
9998
}
10099
}
101-
void clear()
100+
void Clear()
102101
{
103-
startMeasure("clear");
102+
StartMeasure("clear");
104103
this.data = new List<Data>();
105104
this.selected = 0;
106105
}
107-
void swaprows()
106+
void SwapRows()
108107
{
109-
startMeasure("swapRows");
108+
StartMeasure("swapRows");
110109
if (this.data.Count > 998)
111110
{
112111
var a = this.data[1];
@@ -119,7 +118,7 @@ protected override void OnAfterRender(bool firstRender)
119118
{
120119
if (!firstRender)
121120
{
122-
this.stopMeasure();
121+
this.StopMeasure();
123122
}
124123
}
125124
}

0 commit comments

Comments
 (0)