You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
using CPF.Cef; |
|
using CPF.Linux;//如果需要支持Linux才需要 |
|
using CPF.Mac;//如果需要支持Mac才需要 |
|
using CPF.Platform; |
|
using CPF.Skia; |
|
using CPF.Windows; |
|
using System; |
|
|
|
namespace AKS.EnterpriseLibrary.WebBrowser |
|
{ |
|
class Program |
|
{ |
|
[STAThread] |
|
static void Main(string[] args) |
|
{ |
|
Application.Initialize( |
|
(OperatingSystemType.Windows, new WindowsPlatform(), new SkiaDrawingFactory()) |
|
, (OperatingSystemType.OSX, new MacPlatform(), new SkiaDrawingFactory())//如果需要支持Mac才需要 |
|
, (OperatingSystemType.Linux, new LinuxPlatform(), new SkiaDrawingFactory())//如果需要支持Linux才需要 |
|
); |
|
|
|
CefRuntime.Load(); |
|
var mainArgs = new CpfCefMainArgs(args); |
|
var app = new CpfCefApp(); |
|
var exitCode = CefRuntime.ExecuteProcess(mainArgs, app, IntPtr.Zero); |
|
if (exitCode != -1) |
|
{ |
|
return; |
|
} |
|
CefRuntime.Initialize(mainArgs, new CefSettings { }, app, IntPtr.Zero); |
|
|
|
var model = new MainModel(); |
|
Application.Run(new FrmMain { DataContext = model, CommandContext = model }); |
|
|
|
CefRuntime.Shutdown(); |
|
} |
|
} |
|
}
|
|
|