/// <summary> /// Raises the Closing event. /// </summary> /// <param name="e">A <see cref="CancelEventArgs"/> that contains the event data.</param> protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); _parentTaskPane.RefreshDbObjectPanelActionLabelsEnabledStatus(EditingTableName, false); if (EditingWorksheetExists) { UnprotectWorksheet(); EditingWorksheet.UsedRange.Interior.ColorIndex = ExcelInterop.XlColorIndex.xlColorIndexNone; if (!string.IsNullOrEmpty(EditingWorksheet.GetProtectionKey())) { EditingWorksheet.RemoveProtectionKey(); } } WorkbookConnectionInfos.RemoveEditConnectionInfoWithEditDialog(this); Dispose(); }
/// <summary> /// Raises the Closing event. /// </summary> /// <param name="e">A <see cref="CancelEventArgs"/> that contains the event data.</param> protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); _parentTaskPane.RefreshDbObjectPanelActionLabelsEnabledStatus(EditingTableName, false); if (EditingWorksheetExists) { UnprotectWorksheet(); EditingWorksheet.UsedRange.Interior.ColorIndex = ExcelInterop.XlColorIndex.xlColorIndexNone; if (!string.IsNullOrEmpty(EditingWorksheet.GetProtectionKey())) { EditingWorksheet.RemoveProtectionKey(); } } var connectionInfo = Globals.ThisAddIn.ActiveWorkbookEditConnectionInfos.FirstOrDefault(ac => ac.EditDialog.Equals(this)); if (connectionInfo != null) { Globals.ThisAddIn.ActiveWorkbookEditConnectionInfos.Remove(connectionInfo); } Dispose(); }