Skip to content

Commit 046a171

Browse files
Migrate to .NET 6 and Electron.NET 23.6.1
1 parent 3e27644 commit 046a171

40 files changed

+6971
-188
lines changed

AnalysisReport.sarif

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
3+
"version": "2.1.0",
4+
"runs": [
5+
{
6+
"tool": {
7+
"driver": {
8+
"name": "Dependency Analysis",
9+
"semanticVersion": "0.4.355802",
10+
"informationUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview",
11+
"rules": [
12+
{
13+
"id": "UA106",
14+
"name": "PackageToBeAdded",
15+
"fullDescription": {
16+
"text": "Packages that need to be added in order to upgrade the project to chosen TFM"
17+
},
18+
"helpUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview"
19+
}
20+
]
21+
}
22+
},
23+
"results": [
24+
{
25+
"ruleId": "UA106",
26+
"message": {
27+
"text": "Package Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.4.410601 needs to be added."
28+
},
29+
"locations": [
30+
{
31+
"physicalLocation": {
32+
"artifactLocation": {
33+
"uri": "file:///C:/Users/Gregor/source/repos/electron.net-api-demos/ElectronNET-API-Demos/ElectronNET-API-Demos.csproj"
34+
},
35+
"region": {}
36+
}
37+
}
38+
]
39+
},
40+
{
41+
"ruleId": "UA106",
42+
"message": {
43+
"text": "Package Microsoft.AspNetCore.Mvc.NewtonsoftJson, Version=7.0.4 needs to be added."
44+
},
45+
"locations": [
46+
{
47+
"physicalLocation": {
48+
"artifactLocation": {
49+
"uri": "file:///C:/Users/Gregor/source/repos/electron.net-api-demos/ElectronNET-API-Demos/ElectronNET-API-Demos.csproj"
50+
},
51+
"region": {}
52+
}
53+
}
54+
]
55+
}
56+
],
57+
"columnKind": "utf16CodeUnits"
58+
},
59+
{
60+
"tool": {
61+
"driver": {
62+
"name": "API Upgradability",
63+
"semanticVersion": "0.4.355802",
64+
"informationUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview"
65+
}
66+
},
67+
"results": [],
68+
"columnKind": "utf16CodeUnits"
69+
},
70+
{
71+
"tool": {
72+
"driver": {
73+
"name": "Component Analysis",
74+
"semanticVersion": "0.4.355802",
75+
"informationUri": "https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview"
76+
}
77+
},
78+
"results": [],
79+
"columnKind": "utf16CodeUnits"
80+
}
81+
]
82+
}

ElectronNET-API-Demos/Controllers/AboutController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNetCore.Mvc;
22

3-
namespace ElectronNET_API_Demos.Controllers
3+
namespace ElectronNET.WebApp.Controllers
44
{
55
public class AboutController : Controller
66
{

ElectronNET-API-Demos/Controllers/AppSysInformationController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using ElectronNET.API;
44
using ElectronNET.API.Entities;
55

6-
namespace ElectronNET_API_Demos.Controllers
6+
namespace ElectronNET.WebApp.Controllers
77
{
88
public class AppSysInformationController : Controller
99
{
@@ -21,7 +21,7 @@ public IActionResult Index()
2121

2222
Electron.IpcMain.On("sys-info", async (args) =>
2323
{
24-
string homePath = await Electron.App.GetPathAsync(PathName.home);
24+
string homePath = await Electron.App.GetPathAsync(PathName.Home);
2525

2626
var mainWindow = Electron.WindowManager.BrowserWindows.First();
2727
Electron.IpcMain.Send(mainWindow, "got-sys-info", homePath);

ElectronNET-API-Demos/Controllers/ClipboardController.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
using Microsoft.AspNetCore.Mvc;
1+
using System;
2+
using System.Drawing;
3+
using System.IO;
4+
using Microsoft.AspNetCore.Mvc;
25
using ElectronNET.API;
36
using System.Linq;
7+
using ElectronNET.API.Entities;
8+
using Newtonsoft.Json;
49

5-
namespace ElectronNET_API_Demos.Controllers
10+
namespace ElectronNET.WebApp.Controllers
611
{
712
public class ClipboardController : Controller
813
{
@@ -23,6 +28,19 @@ public IActionResult Index()
2328
var mainWindow = Electron.WindowManager.BrowserWindows.First();
2429
Electron.IpcMain.Send(mainWindow, "paste-from", pasteText);
2530
});
31+
32+
Electron.IpcMain.On("copy-image-to", (test) =>
33+
{
34+
var nativeImage = NativeImage.CreateFromDataURL(test.ToString());
35+
Electron.Clipboard.WriteImage(nativeImage);
36+
});
37+
38+
Electron.IpcMain.On("paste-image-to", async test =>
39+
{
40+
var nativeImage = await Electron.Clipboard.ReadImageAsync();
41+
var mainWindow = Electron.WindowManager.BrowserWindows.First();
42+
Electron.IpcMain.Send(mainWindow, "paste-image-from", JsonConvert.SerializeObject(nativeImage));
43+
});
2644
}
2745

2846
return View();

ElectronNET-API-Demos/Controllers/CrashHangController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using ElectronNET.API;
33
using ElectronNET.API.Entities;
44

5-
namespace ElectronNET_API_Demos.Controllers
5+
namespace ElectronNET.WebApp.Controllers
66
{
77
public class CrashHangController : Controller
88
{

ElectronNET-API-Demos/Controllers/DesktopCapturerController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNetCore.Mvc;
22

3-
namespace ElectronNET_API_Demos.Controllers
3+
namespace ElectronNET.WebApp.Controllers
44
{
55
public class DesktopCapturerController : Controller
66
{

ElectronNET-API-Demos/Controllers/DialogsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using ElectronNET.API;
44
using ElectronNET.API.Entities;
55

6-
namespace ElectronNET_API_Demos.Controllers
6+
namespace ElectronNET.WebApp.Controllers
77
{
88
public class DialogsController : Controller
99
{

ElectronNET-API-Demos/Controllers/HomeController.cs

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,47 @@
11
using Microsoft.AspNetCore.Mvc;
2+
using ElectronNET.API;
3+
using System;
24

3-
namespace ElectronNET_API_Demos.Controllers
5+
namespace ElectronNET.WebApp.Controllers
46
{
57
public class HomeController : Controller
68
{
79
public IActionResult Index()
810
{
11+
if (HybridSupport.IsElectronActive)
12+
{
13+
Electron.PowerMonitor.OnLockScreen += () =>
14+
{
15+
Console.WriteLine("Screen Locked detected from C#");
16+
};
17+
18+
Electron.PowerMonitor.OnUnLockScreen += () =>
19+
{
20+
Console.WriteLine("Screen unlocked detected from C# ");
21+
};
22+
23+
Electron.PowerMonitor.OnSuspend += () =>
24+
{
25+
Console.WriteLine("The system is going to sleep");
26+
};
27+
28+
Electron.PowerMonitor.OnResume += () =>
29+
{
30+
Console.WriteLine("The system is resuming");
31+
};
32+
33+
Electron.PowerMonitor.OnAC += () =>
34+
{
35+
Console.WriteLine("The system changes to AC power");
36+
};
37+
38+
Electron.PowerMonitor.OnBattery += () =>
39+
{
40+
Console.WriteLine("The system is about to change to battery power");
41+
};
42+
43+
}
44+
945
return View();
1046
}
1147
}

ElectronNET-API-Demos/Controllers/HostHookController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.AspNetCore.Mvc;
44
using System.Linq;
55

6-
namespace ElectronNET_API_Demos.Controllers
6+
namespace ElectronNET.WebApp.Controllers
77
{
88
public class HostHookController : Controller
99
{

ElectronNET-API-Demos/Controllers/IpcController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using ElectronNET.API;
33
using System.Linq;
44

5-
namespace ElectronNET_API_Demos.Controllers
5+
namespace ElectronNET.WebApp.Controllers
66
{
77
public class IpcController : Controller
88
{

0 commit comments

Comments
 (0)