2018-08-12 15:09:27 +08:00
|
|
|
|
using CefSharp.Wpf;
|
|
|
|
|
using System;
|
2017-03-22 13:04:33 +08:00
|
|
|
|
using System.IO;
|
2016-06-16 06:14:16 +08:00
|
|
|
|
using System.Windows;
|
2013-11-12 19:14:11 +08:00
|
|
|
|
|
|
|
|
|
namespace CefSharp.MinimalExample.Wpf
|
|
|
|
|
{
|
|
|
|
|
public partial class App : Application
|
|
|
|
|
{
|
|
|
|
|
public App()
|
|
|
|
|
{
|
2020-02-10 10:20:12 +08:00
|
|
|
|
#if !NETCOREAPP
|
2017-03-22 13:04:33 +08:00
|
|
|
|
var settings = new CefSettings()
|
|
|
|
|
{
|
|
|
|
|
//By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
|
|
|
|
|
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
|
|
|
|
|
};
|
2019-12-14 09:51:27 +08:00
|
|
|
|
|
2018-07-13 08:48:52 +08:00
|
|
|
|
//Example of setting a command line argument
|
|
|
|
|
//Enables WebRTC
|
2020-05-23 10:11:28 +08:00
|
|
|
|
settings.CefCommandLineArgs.Add("enable-media-stream");
|
2018-06-25 17:18:03 +08:00
|
|
|
|
|
2017-03-22 13:04:33 +08:00
|
|
|
|
//Perform dependency check to make sure all relevant resources are in our output directory.
|
2016-09-15 19:01:04 +08:00
|
|
|
|
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
|
2020-02-10 10:20:12 +08:00
|
|
|
|
#endif
|
2013-11-12 19:14:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|