public TabComponentContainerControl(TabComponentContainer component) { Platform.CheckForNullReference(component, "component"); InitializeComponent(); _component = component; _tabControl.ControlLeftOffset = 3; _tabControl.ControlTopOffset = 3; _tabControl.ControlRightOffset = 3; _tabControl.ControlBottomOffset = 3; foreach (TabPage page in _component.Pages) { Crownwood.DotNetMagic.Controls.TabPage tabPageUI = new Crownwood.DotNetMagic.Controls.TabPage(page.Name); tabPageUI.Tag = page; _tabControl.TabPages.Add(tabPageUI); } _tabControl.SelectionChanged += new Crownwood.DotNetMagic.Controls.SelectTabHandler(OnControlSelectionChanged); _component.CurrentPageChanged += new EventHandler(OnComponentCurrentPageChanged); ShowPage(_component.CurrentPage); }
private void ShowInternal() { if (_desktopObject != null) { _desktopObject.Activate(); return; } List <TabPage> pages = new List <TabPage>(); foreach (IHealthcareArtifactExplorer explorer in GetExplorers()) { IApplicationComponent component = explorer.Component; if (component != null) { pages.Add(new TabPage(explorer.Name, component)); } } if (pages.Count == 0) { return; } TabComponentContainer container = new TabComponentContainer(); foreach (TabPage page in pages) { container.Pages.Add(page); } if (LaunchAsShelf) { ShelfCreationArgs args = new ShelfCreationArgs(); args.Component = container; args.Title = SR.TitleExplorer; args.Name = "Explorer"; args.DisplayHint = ShelfDisplayHint.DockLeft | ShelfDisplayHint.DockAutoHide; _desktopObject = ApplicationComponent.LaunchAsShelf(this.Context.DesktopWindow, args); } else { WorkspaceCreationArgs args = new WorkspaceCreationArgs(); args.Component = container; args.Title = SR.TitleExplorer; args.Name = "Explorer"; args.UserClosable = IsWorkspaceClosable; _desktopObject = ApplicationComponent.LaunchAsWorkspace(this.Context.DesktopWindow, args); } _desktopObject.Closed += delegate { _desktopObject = null; }; }
public override void Start() { _mergedOrderViewComponentContainer = new TabComponentContainer(); _mergedOrderPreviewComponentHost = new ChildComponentHost(this.Host, _mergedOrderViewComponentContainer); _mergedOrderPreviewComponentHost.StartComponent(); _mergedOrderViewComponentContainer.Pages.Add(new TabPage(SR.TitleOrder, _orderPreviewComponent = new MergedOrderDetailViewComponent())); _mergedOrderViewComponentContainer.Pages.Add(new TabPage(SR.TitleOrderAttachments, _attachmentSummaryComponent = new AttachedDocumentPreviewComponent(true, AttachmentSite.Order))); // instantiate all extension pages foreach (IMergeOrdersPageProvider pageProvider in new MergeOrdersPageProviderExtensionPoint().CreateExtensions()) { _extensionPages.AddRange(pageProvider.GetPages(_extensionPageContext)); } // add extension pages to container and set initial context // the container will start those components if the user goes to that page foreach (var page in _extensionPages) { _mergedOrderViewComponentContainer.Pages.Add(new TabPage(page.Path, page.GetComponent())); } // Load form data Platform.GetService( delegate(IBrowsePatientDataService service) { var request = new GetDataRequest { GetOrderDetailRequest = new GetOrderDetailRequest() }; foreach (var orderRef in _orderRefs) { request.GetOrderDetailRequest.OrderRef = orderRef; var response = service.GetData(request); _ordersTable.Items.Add(response.GetOrderDetailResponse.Order); } }); _ordersTable.Sort(); // Re-populate orderRef list by sorted accession number _orderRefs.Clear(); _orderRefs.AddRange(CollectionUtils.Map <OrderDetail, EntityRef>(_ordersTable.Items, item => item.OrderRef)); _selectedOrder = CollectionUtils.FirstElement(_ordersTable.Items); DryRunForSelectedOrder(); base.Start(); }
public override void Start() { // Create component for each tab _bannerComponent = new BannerComponent(); _orderHistoryComponent = new BiographyOrderHistoryComponent(_initialSelectedOrderRef) { PatientRef = _patientRef }; _demographicComponent = new BiographyDemographicComponent { DefaultProfileRef = _profileRef, PatientRef = _patientRef }; _documentComponent = new AttachedDocumentPreviewComponent(true, AttachmentSite.Patient); _noteComponent = new BiographyNoteComponent(); _allergyComponent = new PatientAllergiesComponent(); // Create tab and tab groups _pagesContainer = new TabComponentContainer(); _pagesContainer.Pages.Add(new TabPage(SR.TitleOrders, _orderHistoryComponent)); if (new WorkflowConfigurationReader().EnableVisitWorkflow) { _visitHistoryComponent = new BiographyVisitHistoryComponent { PatientRef = _patientRef }; _pagesContainer.Pages.Add(new TabPage(SR.TitleVisits, _visitHistoryComponent)); } _pagesContainer.Pages.Add(new TabPage(SR.TitleDemographicProfiles, _demographicComponent)); _pagesContainer.Pages.Add(new TabPage(SR.TitlePatientAttachments, _documentComponent)); _pagesContainer.Pages.Add(new TabPage(SR.TitlePatientNotes, _noteComponent)); //_pagesContainer.Pages.Add(new TabPage(SR.TitlePatientAllergies, _allergyComponent)); var tabGroupContainer = new TabGroupComponentContainer(LayoutDirection.Horizontal); tabGroupContainer.AddTabGroup(new TabGroup(_pagesContainer, 1.0f)); _contentComponentHost = new ChildComponentHost(this.Host, tabGroupContainer); _contentComponentHost.StartComponent(); _bannerComponentHost = new ChildComponentHost(this.Host, _bannerComponent); _bannerComponentHost.StartComponent(); _toolSet = new ToolSet(new PatientBiographyToolExtensionPoint(), new PatientBiographyToolContext(this)); LoadPatientProfile(); base.Start(); }
/// <summary> /// Called by the host to initialize the application component. /// </summary> public override void Start() { this.Validation.Add(new ValidationRule("Supervisor", delegate { var ok = _supervisor != null || SubmitForReviewVisible == false; return(new ValidationResult(ok, SR.MessageChooseRadiologist)); })); //// create supervisor lookup handler, using filters supplied in application settings var filters = TranscriptionSettings.Default.SupervisorStaffTypeFilters; var staffTypes = string.IsNullOrEmpty(filters) ? new string[] { } : CollectionUtils.Map <string, string>(filters.Split(','), s => s.Trim()).ToArray(); _supervisorLookupHandler = new StaffLookupHandler(this.Host.DesktopWindow, staffTypes); StartTranscribingWorklistItem(); _bannerHost = new ChildComponentHost(this.Host, new BannerComponent(this.WorklistItem)); _bannerHost.StartComponent(); _rightHandComponentContainer = new TabComponentContainer { ValidationStrategy = new AllComponentsValidationStrategy() }; _orderComponent = new ReportingOrderDetailViewComponent(this.WorklistItem.PatientRef, this.WorklistItem.OrderRef); _rightHandComponentContainer.Pages.Add(new TabPage("Order", _orderComponent)); _rightHandComponentContainerHost = new ChildComponentHost(this.Host, _rightHandComponentContainer); _rightHandComponentContainerHost.StartComponent(); // check for a report editor provider. If not found, use the default one var transcriptionEditorProvider = CollectionUtils.FirstElement <ITranscriptionEditorProvider>( new TranscriptionEditorProviderExtensionPoint().CreateExtensions()); _transcriptionEditor = transcriptionEditorProvider == null ? new TranscriptionEditorComponent(new TranscriptionEditorContext(this)) : transcriptionEditorProvider.GetEditor(new TranscriptionEditorContext(this)); _transcriptionEditorHost = new ChildComponentHost(this.Host, _transcriptionEditor.GetComponent()); _transcriptionEditorHost.StartComponent(); _transcriptionEditorHost.Component.ModifiedChanged += ((sender, args) => this.Modified = this.Modified || _transcriptionEditorHost.Component.Modified); base.Start(); }
public override void Start() { StartProtocollingWorklistItem(); this.Host.Title = ProtocolDocument.GetTitle(this.WorklistItem); _bannerComponentHost = new ChildComponentHost(this.Host, new BannerComponent(this.WorklistItem)); _bannerComponentHost.StartComponent(); _orderNotesComponentHost = new ChildComponentHost(this.Host, new OrderNoteSummaryComponent(OrderNoteCategory.Protocol, this.SaveEnabled)); _orderNotesComponentHost.StartComponent(); ((OrderNoteSummaryComponent)_orderNotesComponentHost.Component).Notes = _notes; _orderNotesComponentHost.Component.ModifiedChanged += ((sender, args) => this.Modified = this.Modified || _orderNotesComponentHost.Component.Modified); _protocolEditorComponentHost = new ChildComponentHost(this.Host, new ProtocolEditorComponent(this.WorklistItem)); _protocolEditorComponentHost.StartComponent(); ((ProtocolEditorComponent)_protocolEditorComponentHost.Component).CanEdit = this.SaveEnabled; _protocolEditorComponentHost.Component.ModifiedChanged += ((sender, args) => this.Modified = this.Modified || _protocolEditorComponentHost.Component.Modified); _rightHandComponentContainer = new TabComponentContainer(); _orderDetailViewComponent = new ProtocollingOrderDetailViewComponent(this.WorklistItem.PatientRef, this.WorklistItem.OrderRef); _rightHandComponentContainer.Pages.Add(new TabPage(SR.TitleOrder, _orderDetailViewComponent)); _orderAttachmentsComponent = new AttachedDocumentPreviewComponent(true, AttachmentSite.Order); _orderAttachmentsComponent.OrderRef = this.WorklistItem.OrderRef; _rightHandComponentContainer.Pages.Add(new TabPage(SR.TitleOrderAttachments, _orderAttachmentsComponent)); _additionalInfoComponent = new OrderAdditionalInfoComponent(true); _additionalInfoComponent.OrderExtendedProperties = _orderDetail.ExtendedProperties; _additionalInfoComponent.Context = new OrderAdditionalInfoComponent.HealthcareContext(this.WorklistItem.OrderRef); _rightHandComponentContainer.Pages.Add(new TabPage(SR.TitleAdditionalInfo, _additionalInfoComponent)); _rightHandComponentContainer.Pages.Add(new TabPage(SR.TitlePriors, _priorReportsComponent = new PriorReportComponent(this.WorklistItem))); _rightHandComponentContainerHost = new ChildComponentHost(this.Host, _rightHandComponentContainer); _rightHandComponentContainerHost.StartComponent(); SetInitialProtocollingTabPage(); base.Start(); }
public override void Start() { _delaySelectionTimer = new Timer(state => SetSelectedOrder(state as EntityRef), _initialSelectedOrderRef, 250); _orderDetailComponent = new BiographyOrderDetailViewComponent(); _visitDetailComponent = new BiographyVisitDetailViewComponent(); _orderReportsComponent = new BiographyOrderReportsComponent(); _orderDocumentComponent = new AttachedDocumentPreviewComponent(true, AttachmentSite.Order); _rightHandComponentContainer = new TabComponentContainer(); _rightHandComponentContainer.Pages.Add(new TabPage("Order Details", _orderDetailComponent)); if (new WorkflowConfigurationReader().EnableVisitWorkflow) { _rightHandComponentContainer.Pages.Add(new TabPage("Visit Details", _visitDetailComponent)); } _rightHandComponentContainer.Pages.Add(new TabPage("Reports", _orderReportsComponent)); _rightHandComponentContainer.Pages.Add(new TabPage("Order Attachments", _orderDocumentComponent)); // instantiate all extension pages _extensionPages = new List <IBiographyOrderHistoryPage>(); foreach (IBiographyOrderHistoryPageProvider pageProvider in new BiographyOrderHistoryPageProviderExtensionPoint().CreateExtensions()) { _extensionPages.AddRange(pageProvider.GetPages(new BiographyOrderHistoryContext(this))); } // add extension pages to container and set initial context // the container will start those components if the user goes to that page foreach (var page in _extensionPages) { _rightHandComponentContainer.Pages.Add(new TabPage(page.Path, page.GetComponent())); } _rightHandComponentContainerHost = new ChildComponentHost(this.Host, _rightHandComponentContainer); _rightHandComponentContainerHost.StartComponent(); LoadOrders(); base.Start(); }
private void InitializeDocumentationTabPages() { var context = new PerformingDocumentationContext(this); _bannerComponentHost = new ChildComponentHost(this.Host, new BannerComponent(_worklistItem)); _bannerComponentHost.StartComponent(); _documentationTabContainer = new TabComponentContainer { ValidationStrategy = new AllComponentsValidationStrategy() }; _orderDetailsComponent = new PerformingDocumentationOrderDetailsComponent(context, _worklistItem); _documentationTabContainer.Pages.Add(new TabPage("Order", _orderDetailsComponent)); _ppsComponent = new PerformedProcedureComponent(_worklistItem, this); _ppsComponent.ProcedurePlanChanged += ((sender, e) => RefreshProcedurePlanSummary(e.ProcedurePlanDetail)); _documentationTabContainer.Pages.Add(new TabPage("Exam", _ppsComponent)); // create extension pages foreach (IPerformingDocumentationPageProvider pageProvider in (new PerformingDocumentationPageProviderExtensionPoint()).CreateExtensions()) { _extensionPages.AddRange(pageProvider.GetPages(context)); } foreach (var page in _extensionPages) { _documentationTabContainer.Pages.Add(new TabPage(page.Path, page.GetComponent())); } // For #7401. Al the pages in this component are explicitly started so data for validation // iill be readily available when user complete the documentation. CollectionUtils.ForEach(_documentationTabContainer.Pages, p => p.LazyStart = false); _documentationHost = new ChildComponentHost(this.Host, _documentationTabContainer); _documentationHost.StartComponent(); SetInitialDocumentationTabPage(); }
public CustomizeViewerActionModelsComponent(IImageViewer imageViewer) { _imageViewer = imageViewer; _reservedKeystrokes = ReservedActionModelKeyStrokeProviderExtensionPoint.GetReservedActionModelKeyStrokes(_imageViewer); _keyStrokeMap = new AssignmentMap <XKeys>(); _initialMouseToolsMap = new AssignmentMap <XMouseButtons>(); _defaultMouseToolsMap = new AssignmentMap <XMouseButtonCombo>(); _mouseButtonMap = new MultiValuedDictionary <XMouseButtons, string>(5); _actionMap = new MultiValuedDictionary <string, AbstractActionModelTreeLeafAction>(); NodePropertiesValidationPolicy validationPolicy = new NodePropertiesValidationPolicy(); validationPolicy.AddRule <AbstractActionModelTreeLeafAction, XMouseButtons>("ActiveMouseButtons", ValidateMouseToolMouseButton); validationPolicy.AddRule <AbstractActionModelTreeLeafClickAction, XKeys>("KeyStroke", this.ValidateClickActionKeyStroke); validationPolicy.AddRule <AbstractActionModelTreeLeafAction, bool>("InitiallyActive", this.ValidateMouseToolInitiallyActive); validationPolicy.AddRule <AbstractActionModelTreeLeafAction, XMouseButtonCombo>("GlobalMouseButtonCombo", this.ValidateDefaultMouseButtons); _validationPolicy = validationPolicy; _tabComponent = new TabComponentContainer(); _tabComponent.CurrentPageChanged += OnTabComponentCurrentPageChanged; _tabComponent.Pages.Add(new TabPage(SR.LabelToolbar, new ImageViewerActionModelConfigurationComponent( _imageViewer.GlobalActionsNamespace, _globalToolbarActionSite, this))); _tabComponent.Pages.Add(new TabPage(SR.LabelContextMenu, new ImageViewerActionModelConfigurationComponent( _imageViewer.ActionsNamespace, _viewerContextMenuActionSite, this))); _tabComponent.Pages.Add(new TabPage(SR.LabelMainMenu, new ImageViewerActionModelConfigurationComponent( _imageViewer.GlobalActionsNamespace, _globalMenusActionSite, this))); _tabComponentHost = new ContainedComponentHost(this, _tabComponent); }
public override void Start() { _staffSummaryComponent = new StaffSummaryComponent { IncludeDeactivatedItems = false, HostedMode = true }; _staffSummaryComponent.SummarySelectionChanged += OnSummaryComponentSummarySelectionChanged; _staffSummaryComponent.ItemDoubleClicked += OnSummaryComponentItemDoubleClicked; _staffGroupSummaryComponent = new StaffGroupSummaryComponent { IncludeDeactivatedItems = false, HostedMode = true }; _staffGroupSummaryComponent.SummarySelectionChanged += OnSummaryComponentSummarySelectionChanged; _staffGroupSummaryComponent.ItemDoubleClicked += OnSummaryComponentItemDoubleClicked; _tabComponentContainer = new TabComponentContainer(); _tabComponentContainer.Pages.Add(new TabPage(SR.TitleStaff, _staffSummaryComponent)); _tabComponentContainer.Pages.Add(new TabPage(SR.TitleStaffGroups, _staffGroupSummaryComponent)); _tabComponentContainerHost = new ChildComponentHost(this.Host, _tabComponentContainer); _tabComponentContainerHost.StartComponent(); base.Start(); }
/// <summary> /// Constructor. /// </summary> /// <param name="tabContainer">The owning container.</param> /// <param name="initialWeight">Initial weight of the tab group, relative to other tab groups.</param> public TabGroup(TabComponentContainer tabContainer, float initialWeight) { _tabContainer = tabContainer; _weight = initialWeight; }
public void SetComponent(IApplicationComponent component) { Platform.CheckForNullReference(component, "component"); _component = (TabComponentContainer)component; }
/// <summary> /// Constructor. /// </summary> /// <param name="tabContainer">The owning container.</param> /// <param name="initialWeight">Initial weight of the tab group, relative to other tab groups.</param> public TabGroup(TabComponentContainer tabContainer, float initialWeight) { _tabContainer = tabContainer; _weight = initialWeight; }
public override void Start() { var resolver = new ResourceResolver(this.GetType().Assembly); _mppsActionHandler = new SimpleActionModel(resolver); _stopAction = _mppsActionHandler.AddAction("stop", SR.TitleStopMpps, "Icons.CheckInToolSmall.png", SR.TitleStopMpps, StopPerformedProcedureStep); _discontinueAction = _mppsActionHandler.AddAction("discontinue", SR.TitleDiscontinueMpps, "Icons.DeleteToolSmall.png", SR.TitleDiscontinueMpps, DiscontinuePerformedProcedureStep); UpdateActionEnablement(); if (_orderRef != null) { Platform.GetService <IModalityWorkflowService>( service => { var mppsRequest = new ListPerformedProcedureStepsRequest(_orderRef); var mppsResponse = service.ListPerformedProcedureSteps(mppsRequest); _mppsTable.Items.AddRange(mppsResponse.PerformedProcedureSteps); _mppsTable.Sort(); }); } // create extension editor pages, if any exist foreach (IPerformedStepEditorPageProvider provider in (new PerformedStepEditorPageProviderExtensionPoint().CreateExtensions())) { _editorPages.AddRange(provider.GetPages(new EditorContext(this))); } // if no editor pages are available via extensions, create the default editor if (_editorPages.Count == 0) { _editorPages.Add(new MppsDocumentationComponent(new EditorContext(this))); if (PerformingDocumentationComponentSettings.Default.ShowDicomSeriesTab) { _editorPages.Add(new PerformedProcedureDicomSeriesComponent(new EditorContext(this))); } } // if there are multiple pages, need to create a tab container if (_editorPages.Count > 1) { var tabContainer = new TabComponentContainer(); _detailsPagesHost = new ChildComponentHost(this.Host, tabContainer); foreach (var page in _editorPages) { tabContainer.Pages.Add(new TabPage(page.Path, page.GetComponent())); } } else { // don't create a tab container for just one page _detailsPagesHost = new ChildComponentHost(this.Host, _editorPages[0].GetComponent()); } // start details pages host _detailsPagesHost.StartComponent(); base.Start(); }
public void SetComponent(IApplicationComponent component) { Platform.CheckForNullReference(component, "component"); _component = (TabComponentContainer)component; }
public static void ShowExplorer(IDesktopWindow desktopWindow) { //try //{ // string[] files = { "e:\\26885681.dcm", "e:\\26885683.dcm" }; // new OpenFilesHelper(files) { WindowBehaviour = ViewerLaunchSettings.WindowBehaviour }.OpenFiles(); //} //catch (Exception e) //{ // //ExceptionHandler.Report(e, SR.MessageUnableToOpenImages, Context.DesktopWindow); //} Platform.Log(LogLevel.Error, "starting download file"); DownloadDicomFile downloadfile = new DownloadDicomFile(); downloadfile.DownloadImages(); string[] files = downloadfile.m_files.ToArray(); string strPatientName = downloadfile.PatientName; try { new OpenFilesHelper(files) { WindowBehaviour = ViewerLaunchSettings.WindowBehaviour }.OpenFiles(strPatientName); } catch (Exception e) { Platform.Log(LogLevel.Error, e.ToString()); //ExceptionHandler.Report(e, SR.MessageUnableToOpenImages, Context.DesktopWindow); } return; if (_desktopObject != null) { _desktopObject.Activate(); return; } //return; List <TabPage> pages = new List <TabPage>(); foreach (IHealthcareArtifactExplorer explorer in GetExplorers()) { IApplicationComponent component = explorer.Component; if (component != null) { pages.Add(new TabPage(explorer.Name, component)); } } if (pages.Count == 0) { return; } TabComponentContainer container = new TabComponentContainer(); foreach (TabPage page in pages) { container.Pages.Add(page); } if (LaunchAsShelf) { ShelfCreationArgs args = new ShelfCreationArgs(); args.Component = container; args.Title = SR.TitleExplorer; args.Name = "Explorer"; args.DisplayHint = ShelfDisplayHint.DockLeft | ShelfDisplayHint.DockAutoHide; _desktopObject = ApplicationComponent.LaunchAsShelf(desktopWindow, args); } else { WorkspaceCreationArgs args = new WorkspaceCreationArgs(); args.Component = container; args.Title = SR.TitleExplorer; //args.Title = "打开本地文件"; args.Name = "Explorer"; args.UserClosable = IsWorkspaceClosable; _desktopObject = ApplicationComponent.LaunchAsWorkspace(desktopWindow, args); } _desktopObject.Closed += delegate { _desktopObject = null; }; }