Ejemplo n.º 1
0
        public PipelineWorkAreaUI(IActivateItems activator, IPipeline pipeline, IPipelineUseCase useCase, ICatalogueRepository catalogueRepository)
        {
            _activator           = activator;
            _pipeline            = pipeline;
            _useCase             = useCase;
            _catalogueRepository = catalogueRepository;

            InitializeComponent();

            olvComponents.BuildGroups(olvRole, SortOrder.Ascending);
            olvComponents.AlwaysGroupByColumn = olvRole;
            olvComponents.FullRowSelect       = true;

            _pipelineDiagram = new PipelineDiagramUI();
            _pipelineDiagram.AllowSelection            = true;
            _pipelineDiagram.AllowReOrdering           = true;
            _pipelineDiagram.SelectedComponentChanged += _pipelineDiagram_SelectedComponentChanged;
            _pipelineDiagram.Dock = DockStyle.Fill;
            diagramPanel.Controls.Add(_pipelineDiagram);

            _arumentsCollection1      = new ArgumentCollectionUI();
            _arumentsCollection1.Dock = DockStyle.Fill;
            gbArguments.Controls.Add(_arumentsCollection1);

            olvComponents.RowFormatter += RowFormatter;
            var context = _useCase.GetContext();

            try
            {
                //middle and destination components
                var allComponentTypes = _catalogueRepository.MEF.GetGenericTypes(typeof(IDataFlowComponent <>), context.GetFlowType());

                //source components (list of all types with MEF exports of )
                var allSourceTypes = _catalogueRepository.MEF.GetGenericTypes(typeof(IDataFlowSource <>), context.GetFlowType());

                _allComponents = new List <AdvertisedPipelineComponentTypeUnderContext>();

                _allComponents.AddRange(allComponentTypes.Select(t => new AdvertisedPipelineComponentTypeUnderContext(t, _useCase)).ToArray());
                _allComponents.AddRange(allSourceTypes.Select(t => new AdvertisedPipelineComponentTypeUnderContext(t, useCase)).ToArray());

                RefreshComponentList();
            }
            catch (Exception exception)
            {
                ExceptionViewer.Show("Failed to get list of supported MEF components that could be added to the pipeline ", exception);
            }

            gbArguments.Enabled = false;

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvComponents, olvCompatible, new Guid("1b8737cb-75d6-401b-b8a2-441e3e4322ac"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvComponents, olvNamespace, new Guid("35c0497e-3c04-46be-a6d6-eb02111aadb3"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvComponents, olvRole, new Guid("fb1205f3-049e-4fe3-89c5-d07b55fa2e17"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvComponents, olvName, new Guid("b7e797e8-ef6a-45d9-b51d-c2f12dbacead"));
        }
Ejemplo n.º 2
0
        public ConfigureAndExecutePipelineUI(PipelineUseCase useCase, IActivateItems activator)
        {
            _useCase = useCase;

            InitializeComponent();

            //designer mode
            if (useCase == null && activator == null)
            {
                return;
            }

            SetItemActivator(activator);
            progressUI1.ApplyTheme(activator.Theme);

            pipelineDiagram1 = new PipelineDiagramUI();

            pipelineDiagram1.Dock = DockStyle.Fill;
            panel_pipelineDiagram1.Controls.Add(pipelineDiagram1);

            fork = new ForkDataLoadEventListener(progressUI1);

            var context = useCase.GetContext();

            if (context.GetFlowType() != typeof(DataTable))
            {
                throw new NotSupportedException("Only DataTable flow contexts can be used with this class");
            }

            foreach (var o in useCase.GetInitializationObjects())
            {
                var de = o as DatabaseEntity;
                if (o is DatabaseEntity)
                {
                    CommonFunctionality.Add(new ExecuteCommandShow(activator, de, 0, true));
                }
                else
                {
                    CommonFunctionality.Add(o.ToString());
                }

                _initializationObjects.Add(o);
            }

            SetPipelineOptions(activator.RepositoryLocator.CatalogueRepository);

            lblTask.Text = "Task:" + useCase.GetType().Name;
        }
Ejemplo n.º 3
0
        public PipelineWorkAreaUI(IActivateItems activator, IPipeline pipeline, IPipelineUseCase useCase, ICatalogueRepository catalogueRepository)
        {
            _activator           = activator;
            _pipeline            = pipeline;
            _useCase             = useCase;
            _catalogueRepository = catalogueRepository;

            InitializeComponent();

            olvComponents.BuildGroups(olvRole, SortOrder.Ascending);
            olvComponents.AlwaysGroupByColumn = olvRole;

            _pipelineDiagram = new PipelineDiagramUI();
            _pipelineDiagram.AllowSelection            = true;
            _pipelineDiagram.AllowReOrdering           = true;
            _pipelineDiagram.SelectedComponentChanged += _pipelineDiagram_SelectedComponentChanged;
            _pipelineDiagram.Dock = DockStyle.Fill;
            diagramPanel.Controls.Add(_pipelineDiagram);

            _arumentsCollection1      = new ArgumentCollectionUI();
            _arumentsCollection1.Dock = DockStyle.Fill;
            gbArguments.Controls.Add(_arumentsCollection1);

            olvComponents.RowFormatter += RowFormatter;
            var context = _useCase.GetContext();

            try
            {
                //middle and destination components
                var allComponentTypes = _catalogueRepository.MEF.GetGenericTypes(typeof(IDataFlowComponent <>), context.GetFlowType());

                //source components (list of all types with MEF exports of )
                var allSourceTypes = _catalogueRepository.MEF.GetGenericTypes(typeof(IDataFlowSource <>), context.GetFlowType());

                olvComponents.AddObjects(allComponentTypes.Select(t => new AdvertisedPipelineComponentTypeUnderContext(t, _useCase)).ToArray());
                olvComponents.AddObjects(allSourceTypes.Select(t => new AdvertisedPipelineComponentTypeUnderContext(t, useCase)).ToArray());
            }
            catch (Exception exception)
            {
                ExceptionViewer.Show("Failed to get list of supported MEF components that could be added to the pipeline ", exception);
            }

            gbArguments.Enabled = false;
        }