/// <summary> /// Creates the Barcode and its view model. /// </summary> /// <param name="protocol">The Protocol Model</param> /// <param name="consumableBarcodeManager">The Consumable Barcode Manager</param> /// <returns>The <see cref="MvvmSet"/>.</returns> public virtual MvvmSet <BarcodeView, BarcodeViewModel> CreateBarcodeMvvmSet(ProtocolModel protocol, IConsumableBarcodeManager consumableBarcodeManager) { BarcodeViewModel barcodeViewModel = new BarcodeViewModel(PatientManager.Factory.Instance.GetPatientManager(), GetBarcodeTraceabilityManager(protocol, consumableBarcodeManager)); return(new MvvmSet <BarcodeView, BarcodeViewModel>(new BarcodeView(), barcodeViewModel)); }
/// <summary> /// Get barcode traceability manager. /// </summary> /// <param name="protocol">The Protocol Model</param> /// <param name="consumableBarcodeManager">The Consumable Barcode Manager</param> /// <returns>The barcode traceability manager.</returns> public virtual IBarcodeTraceabilityManager GetBarcodeTraceabilityManager(ProtocolModel protocol, IConsumableBarcodeManager consumableBarcodeManager) { if (barcodeTraceabilityManager == null) { barcodeTraceabilityManager = new BarcodeTraceabilityManager(DataStorage.Factory.Instance.CreateUnitOfWork(UseCaseNames.WorkflowExecution).BarcodeRepository, protocol, consumableBarcodeManager); } else { barcodeTraceabilityManager.Protocol = protocol; barcodeTraceabilityManager.ConsumableBarcodeManager = consumableBarcodeManager; } return(barcodeTraceabilityManager); }