internal PrintImageViewerControl(PrintImageViewerComponent component) { _component = component; InitializeComponent(); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); _component.Closing += new EventHandler(OnComponentClosing); _component.Drawing += new EventHandler(OnPhysicalWorkspaceDrawing); _component.LayoutCompleted += new EventHandler(OnLayoutCompleted); _component.ScreenRectangleChanged += new EventHandler(OnScreenRectangleChanged); _delayedEventPublisher = new DelayedEventPublisher(OnRecalculateImageBoxes, 50); #region ��ӡ������ printComponent = _component.DicomPrintComponent as DicomPrintComponent; if (printComponent != null) { FilmSize fileSize = printComponent.DicomPrinterConfigurationEditorComponent.FilmSize.ToFilmSize(); FilmOrientation filmOrientation = printComponent.DicomPrinterConfigurationEditorComponent.FilmOrientation; _component.Layout(fileSize, filmOrientation); this.Load += Loaded; } #endregion #region �˵������� this.ToolbarModel = _component.ToolbarModel; this.ContextMenuModel = component.ContextMenuModel; #endregion FilmCount.DataBindings.Add("Text", _component, "FilmCount", true, DataSourceUpdateMode.OnPropertyChanged); ImageCount.DataBindings.Add("Text", _component, "ImageCount", true, DataSourceUpdateMode.OnPropertyChanged); }
protected override void Dispose(bool disposing) { PrintImageViewerComponent printImageViewer = Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null) { return; } printImageViewer.EventBroker.SelectAll -= SelectAll; printImageViewer.EventBroker.SelectRever -= SelectRever; base.Dispose(disposing); }
public override void Initialize() { PrintImageViewerComponent printImageViewer = Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null) { return; } printImageViewer.EventBroker.SelectAll += SelectAll; printImageViewer.EventBroker.SelectRever += SelectRever; base.Initialize(); }
internal static Shelf Launch(IDesktopWindow window) { var component = new PrintImageViewerComponent(window); _printViewImageViewer = component; var shelf = ApplicationComponent.LaunchAsShelf( window, component, "打印预览", ShelfDisplayHint.DockRight ); return(shelf); }
public override void Initialize() { PrintImageViewerComponent printImageViewer = Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null) { return; } printImageViewer.EventBroker.FirstPageEvent += FirstPage; printImageViewer.EventBroker.LastPageEvent += LastPage; printImageViewer.EventBroker.UpPageEvent += UpPage; printImageViewer.EventBroker.DownPageEvent += DownPage; this.Context.Viewer.EventBroker.SelectToolEvent += SelectTool; base.Initialize(); }
protected override void Dispose(bool disposing) { PrintImageViewerComponent printImageViewer = Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null) { return; } printImageViewer.EventBroker.FirstPageEvent -= FirstPage; printImageViewer.EventBroker.LastPageEvent -= LastPage; printImageViewer.EventBroker.UpPageEvent -= UpPage; printImageViewer.EventBroker.DownPageEvent -= DownPage; this.Context.Viewer.EventBroker.SelectToolEvent -= SelectTool; base.Dispose(disposing); }
protected override void Dispose(bool disposing) { PrintImageViewerComponent printImageViewer = Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null) { return; } printImageViewer.EventBroker.CutEvent -= CutEvent; printImageViewer.EventBroker.CopyEvent -= CopyEvent; printImageViewer.EventBroker.PasteEvent -= PasteEvent; printImageViewer.EventBroker.CurrentPageEvent -= DeleteCurrentPage; printImageViewer.EventBroker.CreateEmptyPage -= CreateEmptyPage; base.Dispose(disposing); }
public void PrintPreviewCopy() { if (this.ImageViewer.SelectedImageBox == null || this.ImageViewer.SelectedImageBox.DisplaySet == null || this.Context.Viewer.SelectedPresentationImage == null) { return; } var imageBox = this.ImageViewer.SelectedImageBox; PrintImageViewerComponent component = this.Context.Viewer as PrintImageViewerComponent; if (component == null) { return; } if (selectPresentationImages == null) { selectPresentationImages = new List <IPresentationImage>(); } else { selectPresentationImages.Clear(); } foreach (var selectPresentationImage in component.SelectPresentationImages) { PresentationImage image = ImageExporter.ClonePresentationImage(selectPresentationImage) as PresentationImage; if (image == null) { continue; } image.Selected = false; selectPresentationImages.Add(image); } foreach (PrintViewTile tile in imageBox.Tiles) { if (tile.PresentationImage == null) { tile.Deselect(); } } }
public override bool Start(InputManagement.IMouseInformation mouseInformation) { if (mouseInformation.ClickCount < 2) { return(false); } PrintImageViewerComponent printImageViewer = this.Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null || printImageViewer.SelectPresentationImages == null) { return(false); } foreach (var item in printImageViewer.SelectPresentationImages) { PresentationImage image = item as PresentationImage; image.Selected = false; } printImageViewer.SelectPresentationImages.Clear(); foreach (PrintViewTile tile in this.Context.Viewer.SelectedImageBox.Tiles) { if (tile.PresentationImage == null) { tile.Deselect(); continue; } PresentationImage image = tile.PresentationImage as PresentationImage; image.Selected = true; printImageViewer.SelectPresentationImages.Add(image); } if (printImageViewer.SelectPresentationImages.Count > 0) { PrintViewImageBox imageBox = printImageViewer.SelectedImageBox as PrintViewImageBox; imageBox.SelectedTile = printImageViewer.SelectPresentationImages[0].Tile; } this.Context.Viewer.SelectedImageBox.Draw(); return(true); }
private void SelectRever(object sender, EventArgs args) { PrintImageViewerComponent printImageViewer = Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null || printImageViewer.SelectPresentationImages == null) { return; } foreach (PrintViewTile tile in this.Context.Viewer.SelectedImageBox.Tiles) { if (tile.PresentationImage == null) { tile.Deselect(); } } List <PresentationImage> temp = new List <PresentationImage>(); foreach (var tile in printImageViewer.DisplaySet.PresentationImages) { PresentationImage image = tile as PresentationImage; if (printImageViewer.SelectPresentationImages.Contains(image)) { image.Selected = false; } else { image.Selected = true; temp.Add(image); } } printImageViewer.SelectPresentationImages.Clear(); printImageViewer.SelectPresentationImages.AddRange(temp); if (printImageViewer.SelectPresentationImages.Count > 0) { PrintViewImageBox imageBox = printImageViewer.SelectedImageBox as PrintViewImageBox; imageBox.SelectedTile = printImageViewer.SelectPresentationImages[0].Tile; } this.Context.Viewer.SelectedImageBox.Draw(); }
private void SelectAll(object sender, EventArgs args) { PrintImageViewerComponent printImageViewer = Context.Viewer as PrintImageViewerComponent; if (printImageViewer == null || printImageViewer.SelectPresentationImages == null) { return; } foreach (PrintViewTile tile in this.Context.Viewer.SelectedImageBox.Tiles) { if (tile.PresentationImage == null) { tile.Deselect(); } } foreach (var item in printImageViewer.SelectPresentationImages) { PresentationImage image = item as PresentationImage; image.Selected = false; } printImageViewer.SelectPresentationImages.Clear(); foreach (var tile in printImageViewer.DisplaySet.PresentationImages) { PresentationImage image = tile as PresentationImage; image.Selected = true; printImageViewer.SelectPresentationImages.Add(image); } if (printImageViewer.SelectPresentationImages.Count > 0) { PrintViewImageBox imageBox = printImageViewer.SelectedImageBox as PrintViewImageBox; imageBox.SelectedTile = printImageViewer.SelectPresentationImages[0].Tile; } this.Context.Viewer.SelectedImageBox.Draw(); }
public void SetComponent(IApplicationComponent component) { _component = (PrintImageViewerComponent)component; }
public SaveCustumGridComponent(PrintImageViewerComponent printImageViewerComponent) { _printImageViewerComponent = printImageViewerComponent; }
public PrintImageViewToolContext(PrintImageViewerComponent component) { _component = component; }
private void PropertyChanged() { PrintImageViewerComponent imageViewerComponent = this.ImageViewer as PrintImageViewerComponent; imageViewerComponent.PropertyValueChanged(); }
public void PrintPreviewCut() { if (this.ImageViewer.SelectedImageBox == null || this.ImageViewer.SelectedImageBox.DisplaySet == null || this.Context.Viewer.SelectedPresentationImage == null) { return; } var imageBox = this.ImageViewer.SelectedImageBox; var memorableCommand = new MemorableUndoableCommand(imageBox) { BeginState = CreateMemento() }; PrintImageViewerComponent component = this.Context.Viewer as PrintImageViewerComponent; if (component == null) { return; } if (selectPresentationImages == null) { selectPresentationImages = new List <IPresentationImage>(); } else { selectPresentationImages.Clear(); } foreach (var selectPresentationImage in component.SelectPresentationImages) { var image = selectPresentationImage as PresentationImage; if (image == null) { continue; } image.Selected = false; selectPresentationImages.Add(image); if (imageBox.DisplaySet.PresentationImages.Contains(selectPresentationImage)) { imageBox.DisplaySet.PresentationImages.Remove(selectPresentationImage); } } component.SelectPresentationImages.Clear(); int tileimageIsNullCount = 0; foreach (PrintViewTile tile in imageBox.Tiles) { foreach (var selectPresentationImage in selectPresentationImages) { if (tile.PresentationImage == selectPresentationImage) { tile.PresentationImage = null; } if (tile.PresentationImage == null) { tileimageIsNullCount++; } } tile.Deselect(); } imageBox.TopLeftPresentationImageIndex = tileimageIsNullCount == imageBox.Tiles.Count ? imageBox.TopLeftPresentationImageIndex - imageBox.Tiles.Count : imageBox.TopLeftPresentationImageIndex; imageBox.Draw(); imageBox.SelectDefaultTile(); memorableCommand.EndState = CreateMemento(); var historyCommand = new DrawableUndoableCommand(imageBox) { Name = SR.CommandPrintPreviewCut }; historyCommand.Enqueue(memorableCommand); this.Context.Viewer.CommandHistory.AddCommand(historyCommand); PropertyChanged(); }
public LayoutSelectComponent(PrintImageViewerComponent component) { _component = component; }