Skip to content

Commit b79f224

Browse files
committed
Refactor resolving JS object members, fix tests
1 parent 1d8495c commit b79f224

File tree

13 files changed

+746
-315
lines changed

13 files changed

+746
-315
lines changed

src/Components/Components.sln

Lines changed: 536 additions & 0 deletions
Large diffs are not rendered by default.

src/Components/test/testassets/BasicTestApp/DotNetToJSInterop.razor

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
<div style="margin-top: 2em">
8787
<span>@TestObjectDisplay</span> <br />
8888
<button @onclick="GetObjectModelWithInvoke">Get object model with InvokeAsync</button>
89-
<button @onclick="GetObjectModelWithGetValue">Get object model with GetValue</button>
9089
<button @onclick="GetObjectPropertiesWithGetValue">Get individual object properties with GetValue</button>
9190
</div>
9291

@@ -136,13 +135,6 @@
136135
TestObjectDisplay = $"State loaded from model with Invoke: {model.Num} | {model.Text} | {model.GetOnlyProperty}";
137136
}
138137

139-
private async Task GetObjectModelWithGetValue()
140-
{
141-
var objectRef = await JSRuntime.GetValueAsync<IJSObjectReference>("testObject");
142-
var model = await objectRef.GetValueAsync<TestObjectModel>();
143-
TestObjectDisplay = $"State loaded from reference with GetValue: {model.Num} | {model.Text} | {model.GetOnlyProperty}";
144-
}
145-
146138
private async Task GetObjectPropertiesWithGetValue()
147139
{
148140
var objectRef = await JSRuntime.InvokeAsync<IJSObjectReference>("getTestObject");

src/JSInterop/JSInterop.sln

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.5.2.0
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.JSInterop", "Microsoft.JSInterop", "{858B5D40-ED74-2150-A8A2-365B5B420ABA}"
6+
EndProject
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.JSInterop", "Microsoft.JSInterop\src\Microsoft.JSInterop.csproj", "{CF7471C8-620A-6EBA-58DD-0A6B81AF790B}"
8+
EndProject
9+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.JSInterop.Tests", "Microsoft.JSInterop\test\Microsoft.JSInterop.Tests.csproj", "{60AF6814-2890-E499-8733-A9657CAAD7C1}"
10+
EndProject
11+
Global
12+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
13+
Debug|Any CPU = Debug|Any CPU
14+
Release|Any CPU = Release|Any CPU
15+
EndGlobalSection
16+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
17+
{CF7471C8-620A-6EBA-58DD-0A6B81AF790B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{CF7471C8-620A-6EBA-58DD-0A6B81AF790B}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{CF7471C8-620A-6EBA-58DD-0A6B81AF790B}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{CF7471C8-620A-6EBA-58DD-0A6B81AF790B}.Release|Any CPU.Build.0 = Release|Any CPU
21+
{60AF6814-2890-E499-8733-A9657CAAD7C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22+
{60AF6814-2890-E499-8733-A9657CAAD7C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
23+
{60AF6814-2890-E499-8733-A9657CAAD7C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
24+
{60AF6814-2890-E499-8733-A9657CAAD7C1}.Release|Any CPU.Build.0 = Release|Any CPU
25+
EndGlobalSection
26+
GlobalSection(SolutionProperties) = preSolution
27+
HideSolutionNode = FALSE
28+
EndGlobalSection
29+
GlobalSection(NestedProjects) = preSolution
30+
{CF7471C8-620A-6EBA-58DD-0A6B81AF790B} = {858B5D40-ED74-2150-A8A2-365B5B420ABA}
31+
{60AF6814-2890-E499-8733-A9657CAAD7C1} = {858B5D40-ED74-2150-A8A2-365B5B420ABA}
32+
EndGlobalSection
33+
GlobalSection(ExtensibilityGlobals) = postSolution
34+
SolutionGuid = {0760FACE-6DB9-4BCC-8ADD-82292DDB6BE7}
35+
EndGlobalSection
36+
EndGlobal

0 commit comments

Comments
 (0)