Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Extended .NET 2.0 WebBrowser Control

, 29 Mar 2006
Extending the .NET 2.0 WebBrowser control.
using System;
using System.Collections.Generic;
using System.Text;

namespace ExtendedWebBrowser2
{
  class ScriptErrorManager
  {
    private ScriptErrorManager()
    {
      _scriptErrors = new NotifyCollection<ScriptError>();
    }

    private NotifyCollection<ScriptError> _scriptErrors;

    private static object lockObject = new object();
    private static ScriptErrorManager _instance;

    public static ScriptErrorManager Instance
    {
      get
      {
        if (_instance == null)
        {
          lock (lockObject)
          {
            if (_instance == null)
              _instance = new ScriptErrorManager();
          }
        }
        return _instance;
      }
    }

    public NotifyCollection<ScriptError> ScriptErrors
    {
      get
      {
        return _scriptErrors;
      }
    }

    private ScriptErrorWindow _errorWindow;

    public void RegisterScriptError(Uri url, string description, int lineNumber)
    {
      this._scriptErrors.Add(new ScriptError(url, description, lineNumber));
      if (SettingsHelper.Current.ShowScriptErrors)
      {
        ShowWindow();
      }
    }

    public void ShowWindow()
    {
      if (_errorWindow == null || _errorWindow.IsDisposed)
      {
        _errorWindow = new ScriptErrorWindow();
      }
      _errorWindow.Show();
    }
  }
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jeroen Landheer
Web Developer
Chile Chile
I am
- born in The Netherlands
- living in Chile together with my wife.
- a Microsoft Certified Professional Developer on all 3 areas (Windows, Web and Enterprise)
- an MCITP on Microsoft SQL Server 2005 (Database Administrator)
- an active programmer for about 14 years.
- a business owner, of a Dutch company called "The Wheel Automatisering" (http://www.thewheel.nl)
- a coder in C#, VB.Net and Managed C++.
- someone who likes to share knowledge
 
For fun I like to go out with my dogs, enjoy the sun or write some articles that I share with the community.

| Advertise | Privacy | Mobile
Web02 | 2.8.141022.2 | Last Updated 29 Mar 2006
Article Copyright 2006 by Jeroen Landheer
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid