/// <summary> /// /// </summary> /// <param name="assembly">Resource Assembly</param> /// <param name="schemeName">prefix schema name, default: res, usage: res://</param> /// <param name="domainName">domain name ,default:local,useage with default schema: res://local</param> public static void RegisterEmbeddedScheme(System.Reflection.Assembly assembly, string schemeName = "res", string domainName = "local") { if (string.IsNullOrEmpty(schemeName)) { throw new ArgumentNullException("schemeName", "must set up the schema name。"); } var embedded = new EmbeddedSchemeHandlerFactory(schemeName, domainName, assembly); RegisterScheme(embedded.SchemeName, domainName, embedded); }
public static void RegisterEmbeddedScheme(System.Reflection.Assembly assembly, string schemeName = "embedded", string domainName = null) { if (string.IsNullOrEmpty(schemeName)) { throw new ArgumentNullException("schemeName", "必须为scheme指定名称。"); } var embedded = new EmbeddedSchemeHandlerFactory(schemeName, assembly); var gchandle = GCHandle.Alloc(embedded); ChromiumStartupSettings.SchemeHandlerGCHandles.Add(gchandle); RegisterScheme(embedded.SchemeName, domainName, embedded); }