示例#1
0
        public override void Activate(PipelineComponent target)
        {
            var ui = new ArgumentCollectionUI();

            ui.Setup(ItemActivator, target, target.GetClassAsSystemType(), ItemActivator.RepositoryLocator.CatalogueRepository);
            ItemActivator.ShowWindow(ui, true);
        }
示例#2
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"));
        }
示例#3
0
        public override void SetDatabaseObject(IActivateItems activator, ProcessTask databaseObject)
        {
            _processTask = databaseObject;
            base.SetDatabaseObject(activator, databaseObject);

            if (_argumentCollection == null)
            {
                var repo = databaseObject.CatalogueRepository;

                _argumentCollection = new ArgumentCollectionUI();

                var className = databaseObject.GetClassNameWhoArgumentsAreFor();

                if (string.IsNullOrWhiteSpace(className))
                {
                    activator.KillForm(ParentForm, new Exception("No class has been specified on ProcessTask '" + databaseObject + "'"));
                    return;
                }

                try
                {
                    _underlyingType = repo.MEF.GetType(className);

                    if (_underlyingType == null)
                    {
                        activator.KillForm(ParentForm, new Exception("Could not find Type '" + className + "' for ProcessTask '" + databaseObject + "'"));
                    }
                }
                catch (Exception e)
                {
                    activator.KillForm(ParentForm, new Exception("MEF crashed while trying to look up Type '" + className + "' for ProcessTask '" + databaseObject + "'", e));
                    return;
                }

                _argumentCollection.Setup(databaseObject, _underlyingType, Activator.RepositoryLocator.CatalogueRepository);

                _argumentCollection.Dock = DockStyle.Fill;
                pArguments.Controls.Add(_argumentCollection);
            }

            CommonFunctionality.Add(_ragSmiley);

            CheckComponent();

            loadStageIconUI1.Setup(Activator.CoreIconProvider, _processTask.LoadStage);

            CommonFunctionality.Add(new ToolStripButton("Check", FamFamFamIcons.arrow_refresh, (s, e) => CheckComponent()));
        }
示例#4
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;
        }