private void destroyAttractSection(bool _callback) { if (sec_attract != null) { sec_attract.destroyInternals(); sec_attract.initiateNewCaption -= handleNewCaptionVORequest; sec_attract.incomingPhotoList -= handlePhotoListStateUpdate; if (sec_attract is IDisposable) { (sec_attract as IDisposable).Dispose(); } sec_attract = null; if (_callback == true) { createAttractSection(); } } }
private void createAttractSection() { if (sec_attract == null) { sec_attract = new SectionAttract(_triggerPhotoRefresh, _primaryPhotoReference, ref mainWindow); sec_attract.initiateNewCaption += handleNewCaptionVORequest; sec_attract.incomingPhotoList += handlePhotoListStateUpdate; // will need to add it some how } else { destroyAttractSection(true); } }