Exemplo n.º 1
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List <CefCustomScheme> ParseCommandLineArguments(IEnumerable <string> args)
        {
            var schemes       = args.GetArgumentValue(CefSharpArguments.CustomSchemeArgument);
            var customSchemes = new List <CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                schemes.Split(';').ToList().ForEach(x =>
                {
                    var tokens       = x.Split('|');
                    var customScheme = new CefCustomScheme
                    {
                        SchemeName        = tokens[0],
                        IsStandard        = tokens[1] == "T",
                        IsLocal           = tokens[2] == "T",
                        IsDisplayIsolated = tokens[3] == "T",
                        IsSecure          = tokens[4] == "T",
                        IsCorsEnabled     = tokens[5] == "T",
                        IsCSPBypassing    = tokens[6] == "T"
                    };
                    customSchemes.Add(customScheme);
                });
            }

            return(customSchemes);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List <CefCustomScheme> ParseCommandLineArguments(IEnumerable <string> args)
        {
            var schemes       = args.FirstOrDefault(a => a.StartsWith(CefSharpArguments.CustomSchemeArgument));
            var customSchemes = new List <CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                //Remove the "--custom-scheme=" part of the argument
                schemes.Substring(CefSharpArguments.CustomSchemeArgument.Length + 1).Split(';').ToList().ForEach(x =>
                {
                    var tokens       = x.Split('|');
                    var customScheme = new CefCustomScheme
                    {
                        SchemeName        = tokens[0],
                        IsStandard        = tokens[1] == "T",
                        IsLocal           = tokens[2] == "T",
                        IsDisplayIsolated = tokens[3] == "T",
                        IsSecure          = tokens[4] == "T",
                        IsCorsEnabled     = tokens[5] == "T",
                        IsCSPBypassing    = tokens[6] == "T"
                    };
                    customSchemes.Add(customScheme);
                });
            }

            return(customSchemes);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List <CefCustomScheme> ParseCommandLineArguments(IEnumerable <string> args)
        {
            var schemes       = args.GetArgumentValue(CefSharpArguments.CustomSchemeArgument);
            var customSchemes = new List <CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                schemes.Split(';').ToList().ForEach(x =>
                {
                    var tokens        = x.Split('|');
                    var schemeName    = tokens[0];
                    var schemeOptions = SchemeOptions.None;

                    Enum.TryParse(tokens[1], out schemeOptions);

                    var customScheme = new CefCustomScheme(schemeName, schemeOptions);

                    customSchemes.Add(customScheme);
                });
            }

            return(customSchemes);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Registers a custom scheme using the provided settings.
 /// </summary>
 /// <param name="scheme">The CefCustomScheme which provides the details about the scheme.</param>
 public void RegisterScheme(CefCustomScheme scheme)
 {
     settings.RegisterScheme(scheme);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Method used internally
        /// </summary>
        /// <param name="args">command line arguments</param>
        /// <returns>list of scheme objects</returns>
        public static List<CefCustomScheme> ParseCommandLineArguments(IEnumerable<string> args)
        {
            var schemes = args.FirstOrDefault(a => a.StartsWith(CefSharpArguments.CustomSchemeArgument));
            var customSchemes = new List<CefCustomScheme>();

            if (!string.IsNullOrEmpty(schemes))
            {
                //Remove the "--custom-scheme=" part of the argument
                schemes.Substring(CefSharpArguments.CustomSchemeArgument.Length + 1).Split(';').ToList().ForEach(x =>
                {
                    var tokens = x.Split('|');
                    var customScheme = new CefCustomScheme
                    {
                        SchemeName = tokens[0],
                        IsStandard = tokens[1] == "T",
                        IsLocal = tokens[2] == "T",
                        IsDisplayIsolated = tokens[3] == "T"
                    };
                    customSchemes.Add(customScheme);
                });
            }

            return customSchemes;
        }
Exemplo n.º 6
0
 /// <summary>
 /// Registers a custom scheme using the provided settings.
 /// </summary>
 /// <param name="cefCustomScheme">The CefCustomScheme which provides the details about the scheme.</param>
 public void RegisterScheme(CefCustomScheme cefCustomScheme)
 {
     cefCustomSchemes.Add(cefCustomScheme);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Registers a custom scheme using the provided settings.
 /// </summary>
 /// <param name="cefCustomScheme">The CefCustomScheme which provides the details about the scheme.</param>
 public void RegisterScheme(CefCustomScheme cefCustomScheme)
 {
     cefCustomSchemes.Add(cefCustomScheme);
 }