using System;
using DotNetBrowser;
using DotNetBrowser.Events;

namespace MyNamespace
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create Browser instance.
            Browser browser = BrowserFactory.Create();

            // Register custom LoadHandler implementation.
            browser.LoadHandler = new MyLoadHandler();

            // Load "http://www.google.com" URL.
            browser.LoadURL("http://www.google.com");

            // Dispose Browser instance.
            browser.Dispose();
        }
    }

    public class MyLoadHandler : DefaultLoadHandler
    {
        public override bool OnLoad(LoadParams loadParams)
        {
            // Suppress loading everything with URL that starts with "http://www.google.com".
            if (loadParams.Url.StartsWith("http://www.google.com"))
            {
                return true;
            }
            return false;
        }
    }
}