Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 87afaf8

Browse files
committed
Refactoring soluzione
1 parent 57fe62a commit 87afaf8

File tree

12 files changed

+70
-52
lines changed

12 files changed

+70
-52
lines changed
File renamed without changes.

src/MudBlazor.CustomLibrary.sln renamed to MudBlazor.CustomLibrary.sln

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.2.32505.173
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MudBlazor.CustomLibrary", "MudBlazor.CustomLibrary\MudBlazor.CustomLibrary.csproj", "{8500042A-E9FD-427E-A06F-67BFD89B3EBD}"
7-
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elementi di soluzione", "Elementi di soluzione", "{06F66061-5F79-4CD8-8C9E-7E369F89C534}"
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elementi di soluzione", "Elementi di soluzione", "{18000C95-5BAA-4E70-857D-A11928265E2A}"
97
ProjectSection(SolutionItems) = preProject
108
.editorconfig = .editorconfig
119
EndProjectSection
1210
EndProject
11+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MudBlazor.CustomLibrary", "src\MudBlazor.CustomLibrary\MudBlazor.CustomLibrary.csproj", "{E3B565D1-D28F-434F-8A3B-C44F25954B89}"
12+
EndProject
1313
Global
1414
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1515
Debug|Any CPU = Debug|Any CPU
1616
Release|Any CPU = Release|Any CPU
1717
EndGlobalSection
1818
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19-
{8500042A-E9FD-427E-A06F-67BFD89B3EBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20-
{8500042A-E9FD-427E-A06F-67BFD89B3EBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
21-
{8500042A-E9FD-427E-A06F-67BFD89B3EBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
22-
{8500042A-E9FD-427E-A06F-67BFD89B3EBD}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{E3B565D1-D28F-434F-8A3B-C44F25954B89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{E3B565D1-D28F-434F-8A3B-C44F25954B89}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{E3B565D1-D28F-434F-8A3B-C44F25954B89}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{E3B565D1-D28F-434F-8A3B-C44F25954B89}.Release|Any CPU.Build.0 = Release|Any CPU
2323
EndGlobalSection
2424
GlobalSection(SolutionProperties) = preSolution
2525
HideSolutionNode = FALSE
2626
EndGlobalSection
2727
GlobalSection(ExtensibilityGlobals) = postSolution
28-
SolutionGuid = {37481B16-03C6-4AC4-8C7F-22CDD59FF0A5}
28+
SolutionGuid = {D502743A-7D65-4C2D-B754-1E50BFCA86DA}
2929
EndGlobalSection
3030
EndGlobal
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="my-component">
2+
This component is defined in the <strong>MudBlazor.CustomLibrary</strong> library.
3+
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.my-component {
2+
border: 2px dashed red;
3+
padding: 1em;
4+
margin: 1em 0;
5+
background-image: url('background.png');
6+
}

src/MudBlazor.CustomLibrary/CustomAlert.razor

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/MudBlazor.CustomLibrary/CustomAvatar.razor

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using Microsoft.JSInterop;
2+
3+
namespace MudBlazor.CustomLibrary
4+
{
5+
// This class provides an example of how JavaScript functionality can be wrapped
6+
// in a .NET class for easy consumption. The associated JavaScript module is
7+
// loaded on demand when first needed.
8+
//
9+
// This class can be registered as scoped DI service and then injected into Blazor
10+
// components for use.
11+
12+
public class ExampleJsInterop : IAsyncDisposable
13+
{
14+
private readonly Lazy<Task<IJSObjectReference>> moduleTask;
15+
16+
public ExampleJsInterop(IJSRuntime jsRuntime)
17+
{
18+
moduleTask = new(() => jsRuntime.InvokeAsync<IJSObjectReference>(
19+
"import", "./_content/MudBlazor.CustomLibrary/exampleJsInterop.js").AsTask());
20+
}
21+
22+
public async ValueTask<string> Prompt(string message)
23+
{
24+
var module = await moduleTask.Value;
25+
return await module.InvokeAsync<string>("showPrompt", message);
26+
}
27+
28+
public async ValueTask DisposeAsync()
29+
{
30+
if (moduleTask.IsValueCreated)
31+
{
32+
var module = await moduleTask.Value;
33+
await module.DisposeAsync();
34+
}
35+
}
36+
}
37+
}

src/MudBlazor.CustomLibrary/MudBlazor.CustomLibrary.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5-
<Nullable>disable</Nullable>
5+
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
@using Microsoft.AspNetCore.Components.Web
2-
@using System.ComponentModel.DataAnnotations
3-
4-
@using MudBlazor
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.0",
4-
"publicReleaseRefSpec": [
5-
"^refs/heads/master$" // we release out of master
6-
],
7-
"nugetPackageVersion": {
8-
"semVer": 2
9-
},
10-
"pathFilters": [ "." ]
2+
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3+
"version": "1.0",
4+
"publicReleaseRefSpec": [
5+
"^refs/heads/master$" // we release out of master
6+
],
7+
"nugetPackageVersion": {
8+
"semVer": 2
9+
},
10+
"pathFilters": [ "." ]
1111
}

0 commit comments

Comments
 (0)