InitializeChromium handling
This commit is contained in:
parent
80f3ee0c08
commit
e33b020b56
@ -47,20 +47,22 @@ namespace AlmToolkit
|
|||||||
/// Initialize the chrome browser with the html file to be opened
|
/// Initialize the chrome browser with the html file to be opened
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeChromium()
|
private void InitializeChromium()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// Check if the page exists
|
// Check if the page exists
|
||||||
string page = string.Format(@"{0}\html-resources\dist\index.html", Application.StartupPath);
|
string page = string.Format(@"{0}\html-resources\dist\index.html", Application.StartupPath);
|
||||||
if (!File.Exists(page))
|
if (!File.Exists(page))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Error html file doesn't exist : " + page);
|
MessageBox.Show("Error html file doesn't exist : " + page, Utils.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
CefSettings settings = new CefSettings();
|
CefSettings settings = new CefSettings();
|
||||||
// Initialize cef with the provided settings
|
// Initialize cef with the provided settings
|
||||||
settings.CefCommandLineArgs.Add("disable-gpu", "1");
|
settings.CefCommandLineArgs.Add("disable-gpu", "1");
|
||||||
|
|
||||||
//settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe";
|
settings.BrowserSubprocessPath = @"x86\CefSharp.BrowserSubprocess.exe";
|
||||||
settings.BrowserSubprocessPath = string.Format(@"{0}\x86\CefSharp.BrowserSubprocess.exe", Application.StartupPath); ;
|
//settings.BrowserSubprocessPath = string.Format(@"{0}\x86\CefSharp.BrowserSubprocess.exe", Application.StartupPath); ;
|
||||||
|
|
||||||
Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null);
|
Cef.Initialize(settings, performDependencyCheck: false, browserProcessHandler: null);
|
||||||
// Create a browser component
|
// Create a browser component
|
||||||
@ -78,7 +80,15 @@ namespace AlmToolkit
|
|||||||
// Register C# objects
|
// Register C# objects
|
||||||
chromeBrowser.RegisterAsyncJsObject("chromeDebugger", new ChromeDebugger(chromeBrowser, this));
|
chromeBrowser.RegisterAsyncJsObject("chromeDebugger", new ChromeDebugger(chromeBrowser, this));
|
||||||
chromeBrowser.RegisterAsyncJsObject("comparisonJSInteraction", _comparisonInter);
|
chromeBrowser.RegisterAsyncJsObject("comparisonJSInteraction", _comparisonInter);
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException)
|
||||||
|
{
|
||||||
|
MessageBox.Show("FileNotFoundException in InitializeChromium().\n\nPlease try to install C++ Redistributable Packages for Visual Studio x86, min version www.microsoft.com/download/details.aspx?id=40784", Utils.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
MessageBox.Show(exc.Message, Utils.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComparisonForm_Load(object sender, EventArgs e)
|
private void ComparisonForm_Load(object sender, EventArgs e)
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user