コード例 #1
0
        /// <summary>
        /// Returns the name of the assembly dll
        /// containing wrapper specific implementation
        /// of
        /// </summary>
        /// <param name="wrapper"></param>
        /// <returns></returns>
        public static string GetWrapperAssemblyName(ChromelyCefWrapper wrapper)
        {
            var coreAssembly = typeof(ChromelyRuntime).Assembly;
            var path         = Path.GetDirectoryName(new Uri(coreAssembly.CodeBase).LocalPath) ?? ".";

            var wrapperApi = (wrapper == ChromelyCefWrapper.CefSharp)
                ? ChromelyHostApi.Winapi.ToString()
                : DefaultHostApi.ToString();

            var dllName = Path.Combine(path, $"Chromely.{wrapper}.{wrapperApi}.dll");

            return(dllName);
        }
コード例 #2
0
        /// <summary>
        /// Returns the name of the assembly dll
        /// containing wrapper specific implementation
        /// of
        /// </summary>
        /// <param name="wrapper"></param>
        /// <returns></returns>
        public static string GetWrapperAssemblyName(ChromelyCefWrapper wrapper)
        {
            var coreAssembly = typeof(ChromelyRuntime).Assembly;
            var path         = Path.GetDirectoryName(coreAssembly.Location) ?? ".";

            var wrapperApi = (wrapper == ChromelyCefWrapper.CefSharp)
                ? "Winapi"
                : DefaultWrapperApi;

            var dllName = Path.Combine(path, $"Chromely.{wrapper}.{wrapperApi}.dll");

            return(dllName);
        }
コード例 #3
0
        /// <summary>
        /// The get expected chromium build number.
        /// </summary>
        /// <param name="wrapper">
        /// The wrapper.
        /// </param>
        /// <returns>
        /// The <see cref="int"/>.
        /// </returns>
        public static int GetExpectedChromiumBuildNumber(ChromelyCefWrapper wrapper)
        {
            try
            {
                switch (wrapper)
                {
                case ChromelyCefWrapper.CefGlue:
                    return(GetExpectedChromiumBuildNumberCefGlue(GetWrapperAssemblyName(wrapper)));

                case ChromelyCefWrapper.CefSharp:
                    return(GetExpectedChromiumBuildNumberCefSharp(GetWrapperAssemblyName(wrapper)));
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                // ignore
            }
            return(0);
        }