private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { TaskBarIcon.Dispose(); if (_clipboardService != null) { _clipboardService.Dispose(); } }
/// <summary> /// Ensures that all local service instances /// are safely disposed. /// </summary> private void DisposeServiceInstances() { _scriptVideoService?.Dispose(); _scriptVideoService = null; _systemDialogService = null; _clipboardService?.Dispose(); _clipboardService = null; }
protected virtual void Dispose(bool disposing) { if (disposing) { if (_clipboardService != null) { _clipboardService.Dispose(); _clipboardService = null; } } }
public void Dispose() { _clipboardService?.Dispose(); _clipboardService = null; }