Skip to content

Commit 74db76b

Browse files
authored
Merge pull request #2 from iminakov/develop
Implements first Open Api Diagram Plugin on DotNet for DrawIo
2 parents 671b61a + b1e72c5 commit 74db76b

92 files changed

Lines changed: 4929 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/MapDiagram/App.razor

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Router AppAssembly="@typeof(Program).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
</Found>
5+
<NotFound>
6+
<LayoutView Layout="@typeof(MainLayout)">
7+
<p>Sorry, there's nothing at this address.</p>
8+
</LayoutView>
9+
</NotFound>
10+
</Router>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.1</TargetFramework>
5+
<RazorLangVersion>3.0</RazorLangVersion>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.1.0-preview4.19579.2" />
10+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.1.0-preview4.19579.2" PrivateAssets="all" />
11+
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.1.0-preview4.19579.2" />
12+
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.1.0-preview4.19579.2" PrivateAssets="all" />
13+
</ItemGroup>
14+
15+
</Project>

examples/MapDiagram/MapDiagram.sln

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29609.76
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapDiagram", "MapDiagram.csproj", "{2A2E0D2A-274F-4427-B677-C93A8B47ECD4}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapDiagramTests", "..\MapDiagramTests\MapDiagramTests.csproj", "{E586D606-2BD7-475C-AFD6-2F57C549F243}"
9+
EndProject
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimplePlug", "..\SimplePlug\SimplePlug.csproj", "{E0398637-F499-4240-9D09-7BA7203769E3}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{2A2E0D2A-274F-4427-B677-C93A8B47ECD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{2A2E0D2A-274F-4427-B677-C93A8B47ECD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{2A2E0D2A-274F-4427-B677-C93A8B47ECD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{2A2E0D2A-274F-4427-B677-C93A8B47ECD4}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{E586D606-2BD7-475C-AFD6-2F57C549F243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{E586D606-2BD7-475C-AFD6-2F57C549F243}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{E586D606-2BD7-475C-AFD6-2F57C549F243}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{E586D606-2BD7-475C-AFD6-2F57C549F243}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{E0398637-F499-4240-9D09-7BA7203769E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{E0398637-F499-4240-9D09-7BA7203769E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{E0398637-F499-4240-9D09-7BA7203769E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{E0398637-F499-4240-9D09-7BA7203769E3}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {E900D862-516F-4D1F-A607-F284B46A3C9D}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace MapDiagram.Model
7+
{
8+
public class WeatherForecast
9+
{
10+
public DateTime Date { get; set; }
11+
12+
public int TemperatureC { get; set; }
13+
14+
public string Summary { get; set; }
15+
16+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
17+
}
18+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@page "/counter"
2+
@inherits CounterBase
3+
4+
<h1>Counter</h1>
5+
6+
<p>Current count: @CounterService.Count</p>
7+
8+
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Microsoft.AspNetCore.Components;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
7+
namespace MapDiagram.Pages
8+
{
9+
public class CounterBase : ComponentBase
10+
{
11+
[Parameter]
12+
public int Increment { get; set; } = 1;
13+
14+
[Inject]
15+
protected Services.ICounterService CounterService { get; set; }
16+
17+
protected void IncrementCount()
18+
{
19+
CounterService.Count+=Increment;
20+
}
21+
}
22+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@page "/fetchdata"
2+
@inherits FetchDataBase
3+
<h1>Weather forecast</h1>
4+
5+
<p>This component demonstrates fetching data from the server.</p>
6+
7+
@if (forecasts == null)
8+
{
9+
<p><em>Loading...</em></p>
10+
}
11+
else
12+
{
13+
<table class="table">
14+
<thead>
15+
<tr>
16+
<th>Date</th>
17+
<th>Temp. (C)</th>
18+
<th>Temp. (F)</th>
19+
<th>Summary</th>
20+
</tr>
21+
</thead>
22+
<tbody>
23+
@foreach (var forecast in forecasts)
24+
{
25+
<tr>
26+
<td>@forecast.Date.ToShortDateString()</td>
27+
<td>@forecast.TemperatureC</td>
28+
<td>@forecast.TemperatureF</td>
29+
<td>@forecast.Summary</td>
30+
</tr>
31+
}
32+
</tbody>
33+
</table>
34+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using MapDiagram.Model;
2+
using Microsoft.AspNetCore.Components;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Net.Http;
7+
using System.Threading.Tasks;
8+
9+
namespace MapDiagram.Pages
10+
{
11+
public class FetchDataBase : ComponentBase
12+
{
13+
protected WeatherForecast[] forecasts;
14+
15+
[Inject]
16+
private HttpClient Http { get; set; }
17+
18+
protected override async Task OnInitializedAsync()
19+
{
20+
forecasts = await Http.GetJsonAsync<WeatherForecast[]>("sample-data/weather.json");
21+
}
22+
}
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@page "/"
2+
3+
<h1>Hello, world!</h1>
4+
5+
Welcome to your new app.
6+
7+
<Counter Increment="5" />

examples/MapDiagram/Program.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Microsoft.AspNetCore.Blazor.Hosting;
2+
3+
namespace MapDiagram
4+
{
5+
public class Program
6+
{
7+
public static void Main(string[] args)
8+
{
9+
CreateHostBuilder(args).Build().Run();
10+
}
11+
12+
public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) =>
13+
BlazorWebAssemblyHost.CreateDefaultBuilder()
14+
.UseBlazorStartup<Startup>();
15+
}
16+
}

0 commit comments

Comments
 (0)