public static SynchronizationToolCoordinator Get(IImageViewer viewer)
        {
            if (!Coordinators.ContainsKey(viewer))
            {
                SynchronizationToolCoordinator coordinator = new SynchronizationToolCoordinator(viewer);

                viewer.EventBroker.PresentationImageSelected += coordinator.OnPresentationImageSelected;
                viewer.EventBroker.TileSelected += coordinator.OnTileSelected;

                Coordinators.Add(viewer, coordinator);
            }

            DicomImagePlane.InitializeCache();

            ++Coordinators[viewer]._referenceCount;
            return(Coordinators[viewer]);
        }
Exemple #2
0
        public static SynchronizationToolCoordinator Get(IImageViewer viewer)
        {
            var coordinator = viewer.ExtensionData[typeof(ExtensionDataKey)] as SynchronizationToolCoordinator;

            if (coordinator == null)
            {
                viewer.ExtensionData[typeof(ExtensionDataKey)] = coordinator = new SynchronizationToolCoordinator(viewer);

                viewer.EventBroker.PresentationImageSelected += coordinator.OnPresentationImageSelected;
                viewer.EventBroker.TileSelected += coordinator.OnTileSelected;
            }

            DicomImagePlane.InitializeCache();

            ++coordinator._referenceCount;
            return(coordinator);
        }