public static void Show(IDesktopWindow desktopWindow, ShelfDisplayHint displayHint) { // TODO (CR Phoenix5 - Med): Clinical as well if (!PermissionsHelper.IsInRole(AuthorityTokens.KeyImages)) { throw new PolicyException(SR.ExceptionViewKeyImagePermissionDenied); } desktopWindow = desktopWindow ?? Application.ActiveDesktopWindow; IShelf shelf = GetClipboardShelf(desktopWindow); if (shelf != null) { shelf.Activate(); } else { Workspace activeWorkspace = desktopWindow.ActiveWorkspace; KeyImageInformation info = GetKeyImageInformation(activeWorkspace) ?? new KeyImageInformation(); ClipboardComponent component = new KeyImageClipboardComponent(info); shelf = ApplicationComponent.LaunchAsShelf(desktopWindow, component, SR.TitleKeyImages, displayHint); shelf.Closed += OnClipboardShelfClosed; ClipboardShelves[desktopWindow] = shelf; } }
internal static KeyImageInformation GetKeyImageInformation(IDesktopWindow desktopWindow) { IShelf shelf = GetClipboardShelf(desktopWindow); if (shelf == null) { return(null); } // TODO (CR Phoenix5 - Med): Clinical as well if (!PermissionsHelper.IsInRole(AuthorityTokens.KeyImages)) { throw new PolicyException(SR.ExceptionViewKeyImagePermissionDenied); } KeyImageClipboardComponent component = shelf.Component as KeyImageClipboardComponent; if (component != null) { return(component.KeyImageInformation); } else { return(null); } }
private static void OnWorkspaceActivated(object sender, ItemEventArgs <Workspace> e) { IShelf shelf = GetClipboardShelf(e.Item.DesktopWindow); if (shelf == null) { return; } KeyImageClipboardComponent clipboardComponent = shelf.Component as KeyImageClipboardComponent; if (clipboardComponent == null) { return; } clipboardComponent.KeyImageInformation = GetKeyImageInformation(e.Item) ?? new KeyImageInformation(); }