Exemplo n.º 1
0
        /// <summary>
        /// Gets the <see cref="VolumeCache"/> for the specified <see cref="IImageViewer"/> instance.
        /// </summary>
        public static VolumeCache GetVolumeCache(this IImageViewer imageViewer)
        {
            Platform.CheckForNullReference(imageViewer, "imageViewer");
            var instance = imageViewer.ExtensionData[typeof(VolumeCache)] as VolumeCache;

            if (instance == null)
            {
                imageViewer.ExtensionData[typeof(VolumeCache)] = instance = new VolumeCache();
            }
            return(instance);
        }