v5.0.0
版本发布时间: 2020-02-23 21:59:27
chromelyapps/Chromely最新发布版本:v5.1(2020-10-26 19:05:59)
Chromely v5: A true cross-platform solution.
Chromely has been migrated to .NET Core 3 and now natively supports Windows, Linux and MacOS.
Please see our new and improved Wiki for additional information about Chromely.
Overview
Projects Structure
All projects are now .NET Standard 2.0
- Chromely.Core - no dependencies.
- Chromely.CefGlue - depends on Chromely.Core and embeds CefGlue source code and CefGlue default handlers.
- Chromely - primary - depends on Chromely.CefGlue and includes native gui implementation for Win, Linux and MacOS. All other non-CefGlue customization will be done here.
New Features
- MacOS support using native Cocoa API
- Full IOC - https://github.com/chromelyapps/Chromely/pull/106
- MVC- styled controller actions as discussed in https://github.com/chromelyapps/Chromely/issues/91
- LitJson was replaced by System.Text.Json.
- Optional configuration file - chromelyconfig.json
- Storable App/User settings - IChromelyAppSettings.
- Configuration has received a facelift, see migration guide below for more info.
Fixes
- Fixed WinAPIHost not respecting WindowTitle (Windows)
- ToolTips (html-title) working and positioned correctly. (Linux)
Deprecation & Discontinued
- Winapi was removed in favour of .NET Core 3. Win32 pinvoke functionalities will be sourced in pinvoke.net, shintadono's Win32 and other MIT licensed projects.
- CefSharp is no longer supported.
- Default Sup-process was removed for Windows. Sub-process is configurable and developers who need it can include sub-process fullpath in configuration.
- Real-time with Websocket server was removed.
Quick migration Guide
This guide provides an introduction to Chromely 5 and a set of guidelines to migrate from v4.x to v5.x.
Important upgrade information
- Chromely removed the support for CefSharp, existing CefSharp projects will need to be migrated to CefGlue.
- A Chromely project now requires either .NET Core 3.0 or .NET Framework 4.6.1 and above.
Please see our new and improved Wiki and Demo Projects for additional information on how to create a new project.
Setting up a Chromely application
Chromely v4 (before)
class Program
{
static int Main(string[] args)
{
var startUrl = "https://google.com";
var config = ChromelyConfiguration
.Create()
.WithHostMode(WindowState.Normal, true)
.WithHostTitle("chromely")
.WithHostIconFile("chromely.ico")
.WitAppArgs(args)
.WithHostSize(1000, 600)
.WithStartUrl(startUrl);
using (var window = ChromelyWindow.Create(config))
{
return window.Run(args);
}
}
}
Chromely v5 (now)
class Program
{
static int Main(string[] args)
{
AppBuilder
.Create()
.UseApp<DemoChromelyApp>()
.Build()
.Run(args);
}
}
Configuring a Chromely application
By default Chromely comes with its own default configuration. There are a few ways how you can configure Chromely. The example below overwrites the Default Configuration, this is the easiest way to configure Chromely.
Please see the wiki article about Configuration for other solutions on how to configure Chromely.
using Chromely.Core;
using Chromely.Core.Configuration;
namespace My_Chromely_App
{
class Program
{
static void Main(string[] args)
{
// create a configuration with OS-specific defaults
var config = DefaultConfiguration.CreateForRuntimePlatform();
// your configuration
config.StartUrl = "https://chromely.net/";
config.WindowOptions.Title = "My Awesome Chromely App!";
//..
// application builder
AppBuilder
.Create()
.UseApp<DemoChromelyApp>()
.UseConfiguration<IChromelyConfiguration>(config)
.Build()
.Run(args);
}
}
}
As you can see from the example above, some settings have been regrouped. This makes it easier to find specific settings. E.g. WindowsSettings or CefDownloadOptions.