2016-06-16 06:14:16 +08:00
|
|
|
|
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()
|
|
|
|
|
{
|
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")
|
|
|
|
|
};
|
2016-03-23 13:27:16 +08:00
|
|
|
|
|
2018-06-25 17:18:03 +08:00
|
|
|
|
settings.DisableTouchpadAndWheelScrollLatching();
|
2018-07-13 19:26:07 +08:00
|
|
|
|
|
2018-07-13 08:48:52 +08:00
|
|
|
|
//Example of setting a command line argument
|
|
|
|
|
//Enables WebRTC
|
|
|
|
|
settings.CefCommandLineArgs.Add("enable-media-stream", "1");
|
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);
|
2013-11-12 19:14:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|