예제 #1
0
 private WebView.IHandler Create_WebView2()
 {
     try
     {
         return(WebView2Loader.Create());
     }
     catch
     {
         Debug.WriteLine("Warning: Could not create WebView2 handler. Add Microsoft.Web.WebView2 nuget package to your project to take advantage of the latest web control.");
         // switch to SWF version for subsequent controls
         UseSwfWebView();
         return(new WebViewHandler());
     }
 }
예제 #2
0
파일: Platform.cs 프로젝트: cwensley/Eto
        private WebView.IHandler Create_WebView2()
        {
#if NET45
            Debug.WriteLine("Warning: .NET 4.5 target cannot use WebView2.  Target at least .NET 4.6.2, .NET Core, or .NET 5 instead and install the Microsoft.Web.WebView2 nuget package. Falling back to the Windows Forms WebView.");
            UseSwfWebView();
            return(new WebViewHandler());
#else
            try
            {
                return(WebView2Loader.Create());
            }
            catch
            {
                Debug.WriteLine("Warning: Could not create WebView2 handler. Add Microsoft.Web.WebView2 nuget package to your project to take advantage of the latest web control.");
                // switch to SWF version for subsequent controls
                UseSwfWebView();
                return(new WebViewHandler());
            }
#endif
        }