2016-06-16 06:14:16 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows;
|
2013-11-12 19:14:11 +08:00
|
|
|
|
|
|
|
|
|
namespace CefSharp.MinimalExample.Wpf
|
|
|
|
|
{
|
|
|
|
|
public partial class App : Application
|
|
|
|
|
{
|
|
|
|
|
public App()
|
|
|
|
|
{
|
2015-11-05 07:13:24 +08:00
|
|
|
|
//Perform dependency check to make sure all relevant resources are in our output directory.
|
2016-01-13 08:10:43 +08:00
|
|
|
|
var settings = new CefSettings();
|
|
|
|
|
settings.EnableInternalPdfViewerOffScreen();
|
2016-03-23 13:27:16 +08:00
|
|
|
|
|
2016-06-16 06:14:16 +08:00
|
|
|
|
var osVersion = Environment.OSVersion;
|
|
|
|
|
//Disable GPU for Windows 7
|
|
|
|
|
if (osVersion.Version.Major == 6 && osVersion.Version.Minor == 1)
|
|
|
|
|
{
|
|
|
|
|
// Disable GPU in WPF and Offscreen examples until #1634 has been resolved
|
|
|
|
|
settings.CefCommandLineArgs.Add("disable-gpu", "1");
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-15 19:01:04 +08:00
|
|
|
|
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
|
2013-11-12 19:14:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|