protected override void Dispose(bool disposing) { if (disposing) { if (_logWriter != null) { _logWriter.Flush(); _logWriter.Dispose(); _logWriter = null; } if (_logStream != null) { _logStream.Dispose(); _logStream = null; } _client.UriChecking -= this.UriCheckingHandler; _client.UriChecked -= this.UriCheckedHandler; _client.UriStatusChanged -= this.UriStatusChangedHandler; _client.UriException -= this.UriExceptionHandler; _client.UriSslPolicyError -= this.UriSslPolicyErrorHandler; _client.Checking -= this.CheckingHandler; _client.Checked -= this.CheckedHandler; _client.Dispose(); _client = null; } base.Dispose(disposing); }
public DownDetectorApplicationContext() { _client = new DownDetectorClient(); _client.UriChecking += this.UriCheckingHandler; _client.UriChecked += this.UriCheckedHandler; _client.UriStatusChanged += this.UriStatusChangedHandler; _client.UriException += this.UriExceptionHandler; _client.UriSslPolicyError += this.UriSslPolicyErrorHandler; _client.Checking += this.CheckingHandler; _client.Checked += this.CheckedHandler; this.InitializeLog(); this.LoadSettings(); this.SetDefaultToolTip(); this.SetIcon(); }