/// <summary> /// The create methods. /// </summary> /// <param name="container"> /// The container of <see cref="IChromelyContainer"/> object. /// </param> /// <returns> /// The <see cref="ChromelyConfiguration"/> object. /// </returns> public static ChromelyConfiguration Create(ChromelyHostType hostType = ChromelyHostType.OSDefault, IChromelyContainer container = null) { if (container != null) { IoC.Container = container; } Instance.HostType = hostType; EnsureExpectedWorkingDirectory(); switch (ChromelyRuntime.Platform) { case ChromelyPlatform.MacOSX: Instance.Platform = ChromelyPlatform.MacOSX; return(Instance .WithCustomSetting(CefSettingKeys.MultiThreadedMessageLoop, false) .WithCustomSetting(CefSettingKeys.NoSandbox, true) .WithCommandLineArg("disable-extensions", "1") .WithCommandLineArg("disable-gpu", "1") .WithCommandLineArg("disable-gpu-compositing", "1") .WithCommandLineArg("disable-smooth-scrolling", "1") .WithCommandLineArg("no-sandbox", "1") .WithCommandLineArg("no-zygote", "1")); case ChromelyPlatform.Linux: Instance.Platform = ChromelyPlatform.Linux; return(Instance .WithCustomSetting(CefSettingKeys.MultiThreadedMessageLoop, false) .WithCustomSetting(CefSettingKeys.NoSandbox, true) .WithCommandLineArg("disable-extensions", "1") .WithCommandLineArg("disable-gpu", "1") .WithCommandLineArg("disable-gpu-compositing", "1") .WithCommandLineArg("disable-smooth-scrolling", "1") .WithCommandLineArg("no-sandbox", "1") .WithCommandLineArg("no-zygote", "1")); case ChromelyPlatform.Windows: Instance.Platform = ChromelyPlatform.Windows; if (hostType == ChromelyHostType.OSDefault) { throw new Exception("Windows migration to .NET Core 3 is pending.\nCurrently only Gtk3 is supported on Windows.\n Please check back soon."); } return(Instance); default: throw new PlatformNotSupportedException(); } }
public ChromelyConfiguration WithHostType(ChromelyHostType guiType) { HostType = guiType; return(this); }