コード例 #1
0
        public static void Add(IPresentationImage image)
        {
            Platform.CheckForNullReference(image, "image");
            Platform.CheckForNullReference(image.ImageViewer, "image.ImageViewer");

            // TODO (CR Phoenix5 - Med): Clinical as well
            if (!PermissionsHelper.IsInRole(AuthorityTokens.KeyImages))
            {
                throw new PolicyException(SR.ExceptionCreateKeyImagePermissionDenied);
            }

            KeyImageInformation info = GetKeyImageInformation(image.ImageViewer);

            if (info == null)
            {
                throw new ArgumentException("The specified image's viewer is not valid.", "image");
            }

            IImageSopProvider sopProvider = image as IImageSopProvider;

            if (sopProvider == null)
            {
                throw new ArgumentException("The image must be an IImageSopProvider.", "image");
            }

            info.ClipboardItems.Add(ClipboardComponent.CreatePresentationImageItem(image));
        }