BrowserSubprocess - Add Main method for .Net Core

Needed to test out my idea outlined in https://github.com/cefsharp/CefSharp/issues/2795#issuecomment-592441989
This commit is contained in:
amaitland
2020-03-06 15:50:17 +10:00
parent 4d47b749b1
commit 4e3887d85d
@@ -29,6 +29,29 @@ namespace CefSharp
}
/// <summary>
/// This function should be called from the application entry point function (typically Program.Main)
/// to execute a secondary process e.g. gpu, plugin, renderer, utility
/// This overload is specifically used for .Net Core. For hosting your own BrowserSubProcess
/// it's preferable to use the Main method provided by this class.
/// - Obtains the command line args via a call to Environment::GetCommandLineArgs
/// - Calls CefEnableHighDPISupport before any other processing
/// </summary>
/// <returns>
/// If called for the browser process (identified by no "type" command-line value) it will return immediately
/// with a value of -1. If called for a recognized secondary process it will block until the process should exit
/// and then return the process exit code.
/// </returns
static int MainNetCore()
{
SubProcess::EnableHighDPISupport();
auto args = Environment::GetCommandLineArgs();
auto subProcess = gcnew BrowserSubprocessExecutable();
return subProcess->Main(args, nullptr);
}
/// <summary>
/// This function should be called from the application entry point function (typically Program.Main)
/// to execute a secondary process e.g. gpu, plugin, renderer, utility