-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProgram.cs
More file actions
48 lines (45 loc) · 2.15 KB
/
Copy pathProgram.cs
File metadata and controls
48 lines (45 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// ---------------------------------------------------------------------------------------------------------------------
// Imports
// ---------------------------------------------------------------------------------------------------------------------
using System.Drawing;
using InfiniFrame;
using InfiniFrame.Application;
using InfiniFrame.WebServer;
using InfiniFrame.Window.Features.WebMessaging.Handlers;
namespace InfiniFrameExample.WebApp.Vue;
// ---------------------------------------------------------------------------------------------------------------------
// Code
// ---------------------------------------------------------------------------------------------------------------------
public static class Program {
[STAThread]
public static void Main(string[] args) {
InfiniFrameApplication application = InfiniFrameApplication.CreateBuilder(args)
.WithWindow(window => {
if (OperatingSystem.IsWindows() || OperatingSystem.IsLinux()) window.Debugging.SetRemoteDebuggingPort(9222);
window
.CenteredOnMainMonitor()
// .SetTransparent(true)
// .SetUseOsDefaultSize(false)
.SetTitle("InfiniLore InfiniFrame.NET VUE Sample")
.SetSize(new Size(800, 600))
.SetLocation(1000, 0)
.RegisterFullScreenWebMessageHandler()
.RegisterOpenExternalTargetWebMessageHandler()
.RegisterTitleChangedWebMessageHandler()
.RegisterWindowManagementWebMessageHandler()
.RegisterWebMessageReceivedHandler((_, message) => {
// ReSharper disable twice UnusedVariable
string response = $"Received message: \"{message}\"";
// ... do something with the message
})
;
})
.UseWebServer(builder => {
builder.ConfigureWebApplication(webApp => {
webApp.MapStaticAssets();
});
})
.Build();
application.Run();
}
}