|
using System;
using System.Collections.Generic;
using System.Text;
using ExtendedWebBrowser2.Properties;
namespace ExtendedWebBrowser2
{
/// <summary>
/// This class is used for obtaining and storing settings
/// </summary>
/// <remarks>
/// This is a single instance class, so that there is only one
/// instance needed of the <see cref="Settings"/> class
/// </remarks>
class SettingsHelper
{
/// <summary>
/// Creates a new instance of the <see cref="SettingsHelper"/> class
/// </summary>
private SettingsHelper()
{
_mySettings = new Settings();
}
/// <summary>
/// Stores the instance of the <see cref="Settings"/> class
/// </summary>
private Settings _mySettings;
/// <summary>
/// Stores the instance of the <see cref="SettingsHelper"/> class
/// </summary>
private static SettingsHelper _instance;
/// <summary>
/// An object for locking the thread, when needed
/// </summary>
private static object _lockObject = new object();
/// <summary>
/// Obtains the current instance of the <see cref="SettingsHelper"/> class.
/// </summary>
/// <remarks>
/// If there is no instance of the <see cref="SettingsHelper"/> class, one will be created
/// </remarks>
public static SettingsHelper Current
{
get
{
if (_instance == null)
{
lock (_lockObject)
{
if (_instance == null)
_instance = new SettingsHelper();
}
}
return _instance;
}
}
/// <summary>
/// Gets or sets the <see cref="PopupBlockerFilterLevel"/>
/// </summary>
public PopupBlockerFilterLevel FilterLevel
{
get { return _mySettings.FilterLevel; }
set { _mySettings.FilterLevel = value; }
}
/// <summary>
/// Gets or sets a value indicating if script errors should be shown
/// </summary>
public bool ShowScriptErrors
{
get { return _mySettings.ShowScriptErrors; }
set { _mySettings.ShowScriptErrors = value; }
}
/// <summary>
/// Saves the <see cref="Settings"/>
/// </summary>
public void Save()
{
_mySettings.Save();
}
}
}
|
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.
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