/// <summary>
 /// Removes the search engine. If the search engine is installed in a global
 /// location, this will just hide the engine. If the engine is in the user's
 /// profile directory, it will be removed from disk.
 ///
 /// @param  engine
 /// The engine to remove.
 /// </summary>
 public static void RemoveEngine(SearchEngine engine)
 {
     _browserSearchService.Instance.RemoveEngine(engine._searchEngine);
 }
        /// <summary>
        /// Returns an array of all installed search engines.
        ///
        /// @returns an array of nsISearchEngine objects.
        /// </summary>

        //void GetEngines(ref uint engineCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ref nsISearchEngine[] engines);
        /// <summary>
        /// Returns an array of all installed search engines whose hidden attribute is
        /// false.
        ///
        /// @returns an array of nsISearchEngine objects.
        /// </summary>

        //void GetVisibleEngines(ref uint engineCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ref nsISearchEngine[] engines);
        /// <summary>
        /// Returns an array of all default search engines. This includes all loaded
        /// engines that aren't in the user's profile directory
        /// (NS_APP_USER_SEARCH_DIR).
        ///
        /// @returns an array of nsISearchEngine objects.
        /// </summary>

        //void GetDefaultEngines(ref uint engineCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ref nsISearchEngine[] engines);
        /// <summary>
        /// Moves a visible search engine.
        ///
        /// @param  engine
        /// The engine to move.
        /// @param  newIndex
        /// The engine's new index in the set of visible engines.
        ///
        /// @throws NS_ERROR_FAILURE if newIndex is out of bounds, or if engine is
        /// hidden.
        /// </summary>
        public static void MoveEngine(SearchEngine engine, int newIndex)
        {
            _browserSearchService.Instance.MoveEngine(engine._searchEngine, newIndex);
        }
        /// <summary>
        /// Returns an engine with the specified name.
        /// </summary>
        /// <param name="engineName">The name of the engine.</param>
        /// <returns>The corresponding SearchEngine object, or null if it doesn't exist.</returns>
        public static SearchEngine GetEngineByName(string engineName)
        {
            var ret = nsString.Pass <nsISearchEngine>(_browserSearchService.Instance.GetEngineByName, engineName);

            return(SearchEngine.Create(ret));
        }
        /// <summary>
        /// Returns an engine with the specified alias.
        /// </summary>
        /// <param name="alias">The search engine's alias.</param>
        /// <returns>The corresponding SearchEngine object, or null if it doesn't exist.</returns>
        public static SearchEngine GetEngineByAlias(string alias)
        {
            var ret = nsString.Pass <nsISearchEngine>(_browserSearchService.Instance.GetEngineByAlias, alias);

            return(SearchEngine.Create(ret));
        }
 /// <summary>
 /// Removes the search engine. If the search engine is installed in a global
 /// location, this will just hide the engine. If the engine is in the user's
 /// profile directory, it will be removed from disk.
 ///
 /// @param  engine
 /// The engine to remove.
 /// </summary>
 public static void RemoveEngine(SearchEngine engine)
 {
     _browserSearchService.Instance.RemoveEngine(engine._searchEngine.Instance);
 }
 /// <summary>
 /// Returns an array of all installed search engines.
 ///
 /// @returns an array of nsISearchEngine objects.
 /// </summary>
 //void GetEngines(ref uint engineCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ref nsISearchEngine[] engines);
 /// <summary>
 /// Returns an array of all installed search engines whose hidden attribute is
 /// false.
 ///
 /// @returns an array of nsISearchEngine objects.
 /// </summary>
 //void GetVisibleEngines(ref uint engineCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ref nsISearchEngine[] engines);
 /// <summary>
 /// Returns an array of all default search engines. This includes all loaded
 /// engines that aren't in the user's profile directory
 /// (NS_APP_USER_SEARCH_DIR).
 ///
 /// @returns an array of nsISearchEngine objects.
 /// </summary>
 //void GetDefaultEngines(ref uint engineCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ref nsISearchEngine[] engines);
 /// <summary>
 /// Moves a visible search engine.
 ///
 /// @param  engine
 /// The engine to move.
 /// @param  newIndex
 /// The engine's new index in the set of visible engines.
 ///
 /// @throws NS_ERROR_FAILURE if newIndex is out of bounds, or if engine is
 /// hidden.
 /// </summary>
 public static void MoveEngine(SearchEngine engine, int newIndex)
 {
     _browserSearchService.Instance.MoveEngine(engine._searchEngine.Instance, newIndex);
 }