static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { ServerSettings.Instance().Log.LogError("An unhandled exception occured in CrawlWaver.Service: " + ((Exception)e.ExceptionObject).ToString()); }
/// <summary> /// Provides a global access point for the single instance of the <see cref="ServerSettings"/> /// class. /// </summary> /// <returns>A reference to the single instance of <see cref="ServerSettings"/>.</returns> public static ServerSettings Instance() { if (instance == null) { //Make sure the call is thread-safe. We cannot use the private mutex since //it hasn't yet been initialized - it gets initialized in the constructor. Mutex imutex = new Mutex(); imutex.WaitOne(); if (instance == null) { instance = new ServerSettings(); } imutex.Close(); } return instance; }
/// <summary> /// Constructs a new instance of the <see cref="ServerEngine"/> class and opens a /// connection to the database. /// </summary> public ServerEngine() { settings = ServerSettings.Instance(); dbcon = null; ConnectToDatabase(); }
public Service() { InitializeComponent(); settings = ServerSettings.Instance(); }