Ejemplo n.º 1
0
        /// <summary>
        /// Adds an extension to the Chrome Options object from the app.config
        /// </summary>
        private void AddExtensions()
        {
            try
            {
                var extensionList = Chrome.ExtensionsList;

                if (extensionList != null && extensionList.Contains(","))
                {
                    var list = extensionList.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                    Options.AddExtensions(list);
                }
            }
            catch (Exception ex)
            {
                switch (BaseSettings.DebugLevel)
                {
                case EnumConsoleDebugLevel.Human:
                    Console.Out.WriteLine("Unable to add the extensions specified in the config file");
                    break;

                case EnumConsoleDebugLevel.NotSpecified:
                case EnumConsoleDebugLevel.Message:
                    Console.Out.WriteLine(ex.Message);
                    break;

                case EnumConsoleDebugLevel.StackTrace:
                    Console.Out.WriteLine(ex.Message);
                    Console.Out.WriteLine(ex.StackTrace);
                    break;
                }
            }
        }