Click here to Skip to main content
15,895,746 members
Articles / Web Development / ASP.NET

ASP.NET C# Search Engine (Highlighting, JSON, jQuery & Silverlight)

Rate me:
Please Sign up or sign in to vote.
4.60/5 (38 votes)
8 Mar 2009CPOL10 min read 379.4K   13.2K   184  
More professional ASP.NET C# search with proper document summary, query highlighting and RIA display options
using System;

namespace Searcharoo.Indexer
{
    /// <summary>
    /// Declaring the Event Handler delegate
    /// </summary>
    public delegate void SpiderProgressEventHandler(object source, ProgressEventArgs ea);

    /// <summary>
    /// Progress Message logging level
    /// </summary>
    public enum Level
    { 
        /// <summary>Code *shouldn't* set ProgressEventHandlers to zero</summary>
        None = 0,
        Minimal = 1,
        Informational = 2,
        Detailed = 3,
        VeryDetailed = 4,
        /// <summary>This output should include ALL words in ALL files indexed - it is VERY VERBOSE !!</summary>
        Verbose = 5
    }
    /// <summary>
    /// Declare the Event arguments
    /// </summary>
    public class ProgressEventArgs : EventArgs
    {
        private int _Level = 0;
        private string _Message = null;
        private string _Description = null;

        public ProgressEventArgs(int level, string message)
        {
            this._Level = level;
            this._Message = message;
        }
        
        public ProgressEventArgs(int level, string message, string description)
        {
            this._Level = level;
            this._Message = message;
        }

        public int Level
        {
            get { return this._Level; }
        }

        public string Message
        {
            get { return this._Message; }
        }

        public string Description
        {
            get { return this._Description; }
        }

        public override string ToString()
        {
            return String.Format("{0}:{1}\r\n{2}", _Level, _Message, _Description);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Australia Australia
-- ooo ---
www.conceptdevelopment.net
conceptdev.blogspot.com
www.searcharoo.net
www.recipenow.net
www.racereplay.net
www.silverlightearth.com

Comments and Discussions