protected override void Dispose(bool disposing) { try { if (disposing) { if (newObjectWindowAction != null) { newObjectWindowAction.Execute -= new PopupWindowShowActionExecuteEventHandler(newObjectWindowAction_OnExecute); newObjectWindowAction.CustomizePopupWindowParams -= new CustomizePopupWindowParamsEventHandler(newObjectWindowAction_OnCustomizePopupWindowParams); DisposeAction(newObjectWindowAction); newObjectWindowAction = null; } if (newObjectViewController != null) { newObjectViewController.ObjectCreating -= new EventHandler <ObjectCreatingEventArgs>(newObjectViewController_ObjectCreating); newObjectViewController.ObjectCreated -= new EventHandler <ObjectCreatedEventArgs>(newObjectViewController_ObjectCreated); newObjectViewController = null; } if (frame != null) { frame.SetView(null); frame.Dispose(); frame = null; } if (listView != null) { listView.Dispose(); listView = null; } foreach (IObjectSpace createdObjectSpace in createdObjectSpaces) { if (!createdObjectSpace.IsDisposed) { createdObjectSpace.Dispose(); } } createdObjectSpaces.Clear(); newObject = null; newObjectSpace = null; } } finally { base.Dispose(disposing); } }
protected override void Dispose(bool disposing) { try { if (disposing) { if (_newObjectWindowAction != null) { _newObjectWindowAction.Execute -= newObjectWindowAction_OnExecute; _newObjectWindowAction.CustomizePopupWindowParams -= newObjectWindowAction_OnCustomizePopupWindowParams; DisposeAction(_newObjectWindowAction); _newObjectWindowAction = null; } if (_newObjectViewController != null) { _newObjectViewController.ObjectCreating -= newObjectViewController_ObjectCreating; _newObjectViewController.ObjectCreated -= newObjectViewController_ObjectCreated; _newObjectViewController = null; } if (_frame != null) { _frame.SetView(null); _frame.Dispose(); _frame = null; } if (_listView != null) { _listView.Dispose(); _listView = null; } foreach (IObjectSpace createdObjectSpace in _createdObjectSpaces) { if (!createdObjectSpace.IsDisposed) { createdObjectSpace.Dispose(); } } _createdObjectSpaces.Clear(); _newObject = null; _newObjectSpace = null; } } finally { base.Dispose(disposing); } }