Skip to content

Commit

Permalink
WinForms Example - NoInlining methods to defer loading of CefSharp.* …
Browse files Browse the repository at this point in the history
…dlls until Assembly Resolve is hooked up

Issue https://github.com/jwosty/Interstellar/issues/10
  • Loading branch information
amaitland committed Dec 18, 2020
1 parent 93ada74 commit 84d690a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Examples/Examples.WinForms.Chromium/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ open Interstellar.Chromium.WinForms
open System.Runtime.Versioning

module Main =
[<System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)>]
let runApp () =
Application.EnableVisualStyles ()
Application.SetCompatibleTextRenderingDefault true
Expand All @@ -19,12 +20,17 @@ module Main =
// This is where you could call some WinForms-specific APIs on this window
()
BrowserApp.run (SimpleBrowserApp.app onMainWindowCreated)

[<System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)>]
let shutdownCefSharp() =
Interstellar.Chromium.Platform.Shutdown ()


[<EntryPoint; STAThread>]
let main argv =
Thread.CurrentThread.Name <- "Main"
Trace.WriteLine (sprintf "Starting app. Main thread id: %A" Thread.CurrentThread.ManagedThreadId)
Interstellar.Chromium.Platform.Initialize ()
runApp ()
Interstellar.Chromium.Platform.Shutdown ()
shutdownCefSharp()
0

0 comments on commit 84d690a

Please sign in to comment.