protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { if (null != textEditorControl) { if (false != textEditorControl.EnsureScriptsSaved()) { base.OnClosing(e); } else { e.Cancel = true; } } }