Exemple #1
0
        public ExecuteExtractionUI()
        {
            InitializeComponent();
            AssociatedCollection = RDMPCollection.DataExport;

            checkAndExecuteUI1.CommandGetter = CommandGetter;
            checkAndExecuteUI1.StateChanged += CheckAndExecuteUI1OnStateChanged;
            checkAndExecuteUI1.GroupBySender();

            olvState.ImageGetter  = State_ImageGetter;
            olvState.AspectGetter = State_AspectGetter;

            tlvDatasets.ChildrenGetter         = ChildrenGetter;
            tlvDatasets.CanExpandGetter        = CanExpandGetter;
            tlvDatasets.HierarchicalCheckboxes = true;
            tlvDatasets.ItemActivate          += TlvDatasets_ItemActivate;

            checkAndExecuteUI1.BackColor = Color.FromArgb(240, 240, 240);

            tlvDatasets.CellClick += tlvDatasets_CellClick;

            _coreDatasetsFolder.CommandGetter = () =>
                                                new IAtomicCommand[]
            {
                new ExecuteCommandAddDatasetsToConfiguration(Activator, _extractionConfiguration),
                new ExecuteCommandAddPackageToConfiguration(Activator, _extractionConfiguration),
            };

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvDatasets, olvName, new Guid("57c60bc1-9935-49b2-bb32-58e4c20ad666"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvDatasets, olvState, new Guid("22642c7d-342b-4a6c-b2c4-7ca581877cb2"));
        }
Exemple #2
0
        public ChecksUI()
        {
            InitializeComponent();
            olvChecks.ItemActivate += olvChecks_ItemActivate;
            olvResult.ImageGetter  += ImageGetter;
            olvChecks.RowHeight     = 19;

            _tick      = ChecksAndProgressIcons.Tick;
            _warning   = ChecksAndProgressIcons.Warning;
            _warningEx = ChecksAndProgressIcons.WarningEx;
            _fail      = ChecksAndProgressIcons.Fail;
            _failEx    = ChecksAndProgressIcons.FailEx;

            olvChecks.PrimarySortOrder = SortOrder.Descending;

            olvChecks.UseFiltering = true;
            AllowsYesNoToAll       = true;

            _timer          = new Timer();
            _timer.Interval = 500;
            _timer.Tick    += _timer_Tick;
            _timer.Start();

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvChecks, olvMessage, new Guid("5d62580d-2bee-420b-ab43-f40317769514"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvChecks, olvResult, new Guid("18b26ae1-c35d-4e73-9dc5-88f15910c1f9"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvChecks, olvEventDate, new Guid("28c13822-b4c0-4fa5-b20d-af612b076716"));
        }
Exemple #3
0
        public ExtractableCohortUI()
        {
            InitializeComponent();

            if (VisualStudioDesignMode) //dont add the QueryEditor if we are in design time (visual studio) because it breaks
            {
                return;
            }

            auditLogEditor = new ScintillaTextEditorFactory().Create(new RDMPCombineableFactory(), SyntaxLanguage.LogFile);
            pDescription.Controls.Add(auditLogEditor);
            auditLogEditor.TextChanged += AuditLogEditorOnTextChanged;

            QueryPreview          = new ScintillaTextEditorFactory().Create();
            QueryPreview.ReadOnly = true;

            AssociatedCollection = RDMPCollection.SavedCohorts;

            helpIcon1.SetHelpText("Override Release Identifier", "Not Recommended.  Setting this lets you change which release identifier column is extracted (for this cohort only).");

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCohortUsage, olvUsedIn, new Guid("0c402777-2c70-486a-adb3-32b6f2fbfe80"));

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvPreviousVersions, olvOtherVersions, new Guid("4e753b4a-9989-4bf0-b2d4-7462e68b2fa3"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvPreviousVersions, olvVersion, new Guid("a5b4573f-5aad-456d-a431-d63d69e46e47"));
        }
Exemple #4
0
        public void Test_ArbitraryFolderNode_CommandGetter_Throwing()
        {
            SetupMEF();

            var tlv    = new TreeListView();
            var common = new RDMPCollectionCommonFunctionality();

            common.SetUp(RDMPCollection.None, tlv, ItemActivator, null, null);

            var node = new ArbitraryFolderNode("my node", 0);

            var menu1 = common.GetMenuIfExists(node);

            Assert.IsNotNull(menu1);
            int count1 = menu1.Items.Count;

            //some you get for free e.g. Expand/Collapse
            Assert.GreaterOrEqual(count1, 2);

            //set the menu to have one command in it
            node.CommandGetter = () => new IAtomicCommand[] { new ImpossibleCommand("Do Nothing") };

            var menu2 = common.GetMenuIfExists(node);

            int count2 = menu2.Items.Count;

            Assert.AreEqual(count1 + 1, count2);

            //what happens if the delegate crashes?
            node.CommandGetter = () => throw new NotSupportedException("It went wrong!");

            Assert.DoesNotThrow(() => common.GetMenuIfExists(node));

            AssertErrorWasShown(ExpectedErrorType.GlobalErrorCheckNotifier, "Failed to build menu for my node of Type Rdmp.Core.Providers.Nodes.ArbitraryFolderNode");
        }
        public ParameterCollectionUI()
        {
            InitializeComponent();
            olvParameterName.GroupKeyGetter   += GroupKeyGetter;
            olvParameters.AboutToCreateGroups += olvParameters_AboutToCreateGroups;
            olvParameters.AddDecoration(new EditingCellBorderDecoration {
                UseLightbox = true
            });

            olvParameterName.ImageGetter  += ImageGetter;
            olvParameterName.AspectGetter += ParameterName_AspectGetter;

            olvOwner.AspectGetter            += OwnerAspectGetter;
            olvParameters.CellToolTipShowing += olvParameters_CellToolTipShowing;

            parameterEditorScintillaControl1.ParameterSelected   += (s, e) => olvParameters.SelectObject(e);
            parameterEditorScintillaControl1.ParameterChanged    += (s, e) => olvParameters.RefreshObject(e);
            parameterEditorScintillaControl1.ProblemObjectsFound += RefreshProblemObjects;

            olvParameters.ContextMenuStrip = new ContextMenuStrip();
            olvParameters.ContextMenuStrip.Items.Add(miAddNewParameter);
            olvParameters.ContextMenuStrip.Items.Add(miOverrideParameter);

            miAddNewParameter.Click   += miAddParameter_Click;
            miOverrideParameter.Click += miOverride_Click;

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvParameters, olvComment, new Guid("8058e9c5-236e-443a-8586-6a21bf1a4562"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvParameters, olvOwner, new Guid("e2097029-e35f-4d56-a000-e8cca717b9ad"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvParameters, olvValue, new Guid("cfbab41b-8af1-480c-a7a0-0bbf42ee8cb9"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvParameters, olvParameterName, new Guid("eadfd8e8-db88-4632-badc-0c6dbec2f877"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvParameters, olvParameterSQL, new Guid("a9216170-621d-45c6-9d32-9046a054fc0f"));
        }
Exemple #6
0
        //constructor
        public LoadEventsTreeView()
        {
            InitializeComponent();

            _populateLoadHistory.DoWork += _populateLoadHistory_DoWork;
            _populateLoadHistory.WorkerSupportsCancellation = true;
            _populateLoadHistory.RunWorkerCompleted        += _populateLoadHistory_RunWorkerCompleted;

            treeView1.CanExpandGetter  += CanExpandGetter;
            treeView1.ChildrenGetter   += ChildrenGetter;
            treeView1.FormatRow        += treeView1_FormatRow;
            treeView1.UseFiltering      = true;
            olvDescription.UseFiltering = true;

            olvDate.AspectGetter        += olvDate_AspectGetter;
            olvDescription.AspectGetter += olvDescription_AspectGetter;

            //We will handle this ourselves because default behaviour is to limit the amount of text copied
            treeView1.CopySelectionOnControlC = false;

            _btnApplyFilter.Click  += (s, e) => ApplyFilter(_tbFilterBox.Text);
            _tbToFetch.TextChanged += TbToFetchTextChanged;
            _btnFetch.Click        += (s, e) => PopulateLoadHistory();

            RDMPCollectionCommonFunctionality.SetupColumnTracking(treeView1, olvDescription, new Guid("6b09f39c-2b88-41ed-a396-42a2d2288952"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(treeView1, olvDate, new Guid("d0caf588-cff8-4e49-b755-ed9aaf320f1a"));
        }
        public GovernancePeriodUI()
        {
            InitializeComponent();
            AssociatedCollection = RDMPCollection.Catalogue;

            olvName.ImageGetter = s => Activator.CoreIconProvider.GetImage(s);

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvCatalogues, olvName, new Guid("6702de5f-490f-4235-bce4-dea0cbd23f06"));
        }
        public override void SetDatabaseObject(IActivateItems activator, CohortIdentificationConfiguration databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _configuration = databaseObject;

            RebuildClearCacheCommand();

            gbCicInfo.Text     = $"Name: {_configuration.Name}";
            tbDescription.Text = $"Description: {_configuration.Description}";
            ticket.TicketText  = _configuration.Ticket;

            if (_commonFunctionality == null)
            {
                activator.RefreshBus.Subscribe(this);
                _commonFunctionality = new RDMPCollectionCommonFunctionality();

                _commonFunctionality.SetUp(RDMPCollection.Cohort, tlvCic, activator, olvNameCol, olvNameCol, new RDMPCollectionCommonFunctionalitySettings
                {
                    SuppressActivate   = true,
                    AddFavouriteColumn = false,
                    AddCheckColumn     = false,
                    AllowPinning       = false,
                    AllowSorting       = true, //important, we need sorting on so that we can override sort order with our OrderableComparer
                });
                _commonFunctionality.MenuBuilt += MenuBuilt;
                tlvCic.AddObject(_configuration);
                tlvCic.ExpandAll();
            }

            CommonFunctionality.AddToMenu(cbIncludeCumulative);
            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(new ExecuteCommandSetQueryCachingDatabase(Activator, _configuration));
            CommonFunctionality.AddToMenu(new ExecuteCommandClearQueryCache(Activator, _configuration));
            CommonFunctionality.AddToMenu(new ExecuteCommandCreateNewQueryCacheDatabase(activator, _configuration));
            CommonFunctionality.AddToMenu(
                new ExecuteCommandSet(activator, _configuration, _configuration.GetType().GetProperty("Description"))
            {
                OverrideIcon =
                    Activator.CoreIconProvider.GetImage(RDMPConcept.CohortIdentificationConfiguration, OverlayKind.Edit)
            });
            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(new ExecuteCommandShowXmlDoc(activator, "CohortIdentificationConfiguration.QueryCachingServer_ID", "Query Caching"), "Help (What is Query Caching)");
            CommonFunctionality.Add(new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(activator, null).SetTarget(_configuration),
                                    "Commit Cohort",
                                    activator.CoreIconProvider.GetImage(RDMPConcept.ExtractableCohort, OverlayKind.Add));

            foreach (var c in _timeoutControls.GetControls())
            {
                CommonFunctionality.Add(c);
            }

            _queryCachingServer = _configuration.QueryCachingServer;
            Compiler.CohortIdentificationConfiguration = _configuration;
            Compiler.CoreChildProvider = activator.CoreChildProvider;
            RecreateAllTasks();
        }
Exemple #9
0
        public ExecuteCommandExpandAllNodes(IActivateItems activator, RDMPCollectionCommonFunctionality commonFunctionality, object rootToCollapseTo) : base(activator)
        {
            _commonFunctionality = commonFunctionality;
            _rootToExpandFrom    = rootToCollapseTo;

            if (!commonFunctionality.Tree.CanExpand(rootToCollapseTo))
            {
                SetImpossible("Node cannot be expanded");
            }
        }
        public ExecuteCommandCollapseChildNodes(IActivateItems activator, RDMPCollectionCommonFunctionality commonFunctionality, object rootToCollapseTo) : base(activator)
        {
            _commonFunctionality = commonFunctionality;
            _rootToCollapseTo    = rootToCollapseTo;

            if (!_commonFunctionality.Tree.IsExpanded(rootToCollapseTo))
            {
                SetImpossible("Node is not expanded");
            }
        }
        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"));
        }
        //constructor
        public ConfigureDatasetUI()
        {
            InitializeComponent();

            olvAvailableColumnName.ImageGetter += ImageGetter;
            olvSelectedColumnName.ImageGetter  += ImageGetter;

            olvSelected.ItemActivate += OlvSelected_ItemActivate;

            olvAvailableColumnCategory.AspectGetter += AvailableColumnCategoryAspectGetter;
            olvAvailable.AlwaysGroupByColumn         = olvAvailableColumnCategory;
            olvSelectedCatalogue.AspectGetter       += SelectedCatalogue_AspectGetter;
            olvSelectedCategory.AspectGetter        += SelectedCategory_AspectGetter;

            SimpleDropSink dropSink = (SimpleDropSink)olvSelected.DropSink;

            dropSink.CanDropOnItem  = false;
            dropSink.CanDropBetween = true;
            AssociatedCollection    = RDMPCollection.DataExport;

            var tableInfoIcon = CatalogueIcons.TableInfo;

            olvJoinTableName.ImageGetter += o => tableInfoIcon;
            olvJoin.CheckStateGetter     += ForceJoinCheckStateGetter;
            olvJoin.CheckStatePutter     += ForceJoinCheckStatePutter;

            olvJoinColumn.AspectGetter += JoinColumn_AspectGetter;
            olvJoin.ButtonClick        += olvJoin_ButtonClick;

            olvJoinColumn.EnableButtonWhenItemIsDisabled = true;

            olvIssues.AspectGetter += Issues_AspectGetter;

            olvSelected.UseCellFormatEvents = true;
            olvSelected.FormatCell         += olvSelected_FormatCell;
            olvSelected.CellRightClick     += olvSelected_CellRightClick;

            helpIconJoin.SetHelpText("Configure JoinInfos", "Your query involves more than 1 table and RDMP does not yet know which columns to use to join the tables on.  Click the 'Configure' button below on any ticked tables for which no joins are shown");

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvAvailable, olvAvailableColumnCategory, new Guid("e515dd51-6ab4-4e62-8d58-0081dde77646"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvAvailable, olvAvailableColumnName, new Guid("f40a31b5-4a64-44b5-9d21-54595f8671b1"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvAvailable, olvAvailableIsExtractionIdentifier, new Guid("6741ea5c-5a1e-482a-943e-5d9bcfde4a1f"));

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvJoin, olvJoinColumn, new Guid("7e034241-9d7a-48a6-869c-a0831303839a"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvJoin, olvJoinTableName, new Guid("7b0b0c8f-b648-47cc-a14f-6dce54333d0b"));

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvSelected, olvSelectedCatalogue, new Guid("7ec2a0b8-cc84-4759-8f78-0f2c492ae408"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvSelected, olvSelectedCategory, new Guid("e0cc6915-15ad-4148-adf1-978489e36940"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvSelected, olvSelectedColumnName, new Guid("061b5ef1-d0bd-4be6-9e9a-1a6a9c13a01c"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvSelected, olvSelectedColumnOrder, new Guid("2b4db0ee-3768-4e0e-a62b-e5a9b19e91a7"));

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvSelected, olvIssues, new Guid("741f0cff-1d2e-46a7-a5da-9ce13e0960cf"));
        }
        public PerformanceCounterResultsUI()
        {
            InitializeComponent();

            tlvLocations.CanExpandGetter += CanExpandGetter;
            tlvLocations.ChildrenGetter  += ChildrenGetter;
            tlvLocations.RowFormatter    += RowFormatter;

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvLocations, olvQueryCount, new Guid("576c87c7-a324-45bb-a4bc-4757044f7c43"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvLocations, olvQueryCount, new Guid("905e5565-0428-4734-8582-9734546d55a3"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvLocations, olvStackFrame, new Guid("865f84a1-f0c4-48d9-8983-10d35cf4a513"));
        }
        public ReOrderCatalogueItemsUI()
        {
            InitializeComponent();
            splitContainer1.Panel2Collapsed = true;
            AssociatedCollection            = RDMPCollection.Catalogue;
            helpIcon1.SetHelpText("Re Order",
                                  "Instructions: In simple mode you can view your columns and drag and drop them to reorder them.  In Advanced mode you can also Paste (Ctrl + V)  a list of column names into Desired Order (dont worry about trimming commas or table prefixes etc).  The first item in the list should be the point at which you want to start reordering at e.g. CHI or the last record if you want to move columns to the end then paste in the rest of the columns that you want to move after this first item."
                                  );

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvExtractionInformations, olvColumns, new Guid("35946a6e-ebe4-496a-a944-1ddb10b5f8c5"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvExtractionInformations, olvOrder, new Guid("d11d4b84-2464-4254-a3cb-b656c55dd0fc"));
        }
        public CohortIdentificationConfigurationUI()
        {
            InitializeComponent();

            Compiler = new CohortCompiler(null);

            olvExecute.IsButton      = true;
            olvExecute.ButtonSizing  = OLVColumn.ButtonSizingMode.CellBounds;
            tlvCic.RowHeight         = 19;
            olvExecute.AspectGetter += ExecuteAspectGetter;
            tlvCic.ButtonClick      += tlvCic_ButtonClick;
            olvOrder.AspectGetter   += (o) => o is JoinableCollectionNode ? null : o is ISqlParameter ? null : (o as IOrderable)?.Order;
            olvOrder.IsEditable      = false;
            tlvCic.ItemActivate     += TlvCic_ItemActivate;
            AssociatedCollection     = RDMPCollection.Cohort;


            timer.Tick    += refreshColumnValues;
            timer.Interval = 2000;
            timer.Start();

            olvCount.AspectGetter           = Count_AspectGetter;
            olvCached.AspectGetter          = Cached_AspectGetter;
            olvCumulativeTotal.AspectGetter = CumulativeTotal_AspectGetter;
            olvTime.AspectGetter            = Time_AspectGetter;
            olvWorking.AspectGetter         = Working_AspectGetter;
            olvCatalogue.AspectGetter       = Catalogue_AspectGetter;

            cbIncludeCumulative.CheckedChanged += (s, e) =>
            {
                Compiler.IncludeCumulativeTotals = cbIncludeCumulative.Checked;
                RecreateAllTasks();
            };

            //This is important, OrderableComparer ensures IOrderable objects appear in the correct order but the comparator
            //doesn't get called unless the column has a sorting on it
            olvNameCol.Sortable = true;
            tlvCic.Sort(olvNameCol);

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvCached, new Guid("59c6eda9-dcf3-4a24-801f-4c5467c76f94"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvCatalogue, new Guid("59c6f9a6-4a93-4167-a268-9ea755d0ad94"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvCount, new Guid("4ca6588f-2511-4082-addd-ec42e9d75b39"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvCumulativeTotal, new Guid("a3e901e2-c6b8-4365-bea8-5666b9b74821"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvExecute, new Guid("f8ad1751-b273-42d7-a6d1-0c580099ceee"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvNameCol, new Guid("63db1af5-061c-42b9-873c-7d3d3ac21cd8"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvOrder, new Guid("5be4e6e7-bad6-4bd5-821c-a235bc056053"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvTime, new Guid("88f88d4a-6204-4f83-b9a7-5421186808b7"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCic, olvWorking, new Guid("cfe55a4f-9e17-4205-9016-ae506667f22d"));

            tt.SetToolTip(btnExecute, "Starts running and caches all cohort sets and containers");
            tt.SetToolTip(btnAbortLoad, "Cancells execution of any running cohort sets");
        }
        public ExecuteCommandCollapseChildNodes(IActivateItems activator, RDMPCollectionCommonFunctionality commonFunctionality, object rootToCollapseTo) : base(activator)
        {
            _commonFunctionality = commonFunctionality;
            _rootToCollapseTo    = rootToCollapseTo;

            // collapse all with no node selected collapses whole tree
            if (_rootToCollapseTo is RDMPCollection)
            {
                return;
            }

            if (!_commonFunctionality.Tree.IsExpanded(rootToCollapseTo))
            {
                SetImpossible("Node is not expanded");
            }
        }
Exemple #17
0
        public ExecuteCommandExpandAllNodes(IActivateItems activator, RDMPCollectionCommonFunctionality commonFunctionality, object toExpand) : base(activator)
        {
            _commonFunctionality = commonFunctionality;
            _rootToExpandFrom    = toExpand;

            // if we are expanding everything in the tree that is ok
            if (_rootToExpandFrom is RDMPCollection)
            {
                return;
            }

            if (!commonFunctionality.Tree.CanExpand(toExpand))
            {
                SetImpossible("Node cannot be expanded");
            }
        }
        public override void SetDatabaseObject(IActivateItems activator, Catalogue databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            serverDatabaseTableSelector1.SetItemActivator(activator);
            try
            {
                _planManager = new ForwardEngineerANOCataloguePlanManager(activator.RepositoryLocator, databaseObject);
            }
            catch (QueryBuildingException e)
            {
                CommonFunctionality.Fatal("Could not generate a valid query for the Catalogue", e);
                return;
            }

            if (!_setup)
            {
                var settings = new RDMPCollectionCommonFunctionalitySettings {
                    AddFavouriteColumn = false, AllowPinning = false, AddCheckColumn = false
                };

                //Set up tree view to show ANO Tables that are usable
                tlvANOTablesCommonFunctionality = new RDMPCollectionCommonFunctionality();
                tlvANOTablesCommonFunctionality.SetUp(RDMPCollection.None, tlvANOTables, activator, olvANOTablesName, null, settings);

                tlvANOTables.AddObject(activator.CoreChildProvider.AllANOTablesNode);
                tlvANOTables.ExpandAll();

                //Setup tree view to show all TableInfos that you are trying to Migrate
                tlvTableInfoMigrationsCommonFunctionality = new RDMPCollectionCommonFunctionality();
                tlvTableInfoMigrationsCommonFunctionality.SetUp(RDMPCollection.None, tlvTableInfoMigrations, activator, olvTableInfoName, null, settings);

                //don't display anything below ColumnInfo
                tlvTableInfoMigrationsCommonFunctionality.AxeChildren = new[] { typeof(ColumnInfo) };

                _setup = true;
            }

            //Add them and expand them
            tlvTableInfoMigrations.ClearObjects();
            tlvTableInfoMigrations.AddObjects(_planManager.TableInfos);
            tlvTableInfoMigrations.ExpandAll();

            ddDateColumn.DataSource = _planManager.TableInfos.SelectMany(t => t.ColumnInfos).Where(c => c.Data_type != null && c.Data_type.Contains("date")).ToArray();

            Check();
        }
Exemple #19
0
        public DataLoadsGraph()
        {
            InitializeComponent();

            SetupOlvDelegates();

            olvDataLoads.AlwaysGroupByColumn = olvStatus;
            olvDataLoads.UseCellFormatEvents = true;
            olvDataLoads.FormatCell         += olvDataLoads_FormatCell;

            olvViewLog.AspectGetter += (s) => "View Log";

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvDataLoads, olvName, new Guid("4a651e11-62f5-4d8f-8fe5-4db488ee7f3a"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvDataLoads, olvLastRun, new Guid("1aadf2e8-798d-4e85-8abc-7f45edb839b7"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvDataLoads, olvCategory, new Guid("406173bc-44a0-40b7-8bd1-d01a214c277d"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvDataLoads, olvStatus, new Guid("8c5cbcd2-9f06-4e24-9521-c3be7ea22eca"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvDataLoads, olvViewLog, new Guid("e9c04da0-0e91-442e-90a4-119a1b67ea06"));
        }
Exemple #20
0
        public override void SetDatabaseObject(IActivateItems activator, CohortIdentificationConfiguration databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);
            _configuration = databaseObject;

            lblFrozen.Visible = _configuration.Frozen;

            tbID.Text          = _configuration.ID.ToString();
            tbName.Text        = _configuration.Name;
            tbDescription.Text = _configuration.Description;
            ticket.TicketText  = _configuration.Ticket;
            tlvCic.Enabled     = !databaseObject.Frozen;

            if (_commonFunctionality == null)
            {
                _commonFunctionality = new RDMPCollectionCommonFunctionality();

                _commonFunctionality.SetUp(RDMPCollection.Cohort, tlvCic, activator, olvNameCol, olvNameCol, new RDMPCollectionCommonFunctionalitySettings
                {
                    AddFavouriteColumn = false,
                    AddCheckColumn     = false,
                    AllowPinning       = false,
                    AllowSorting       = true, //important, we need sorting on so that we can override sort order with our OrderableComparer
                });

                tlvCic.AddObject(_configuration);
                tlvCic.ExpandAll();
            }

            CommonFunctionality.AddToMenu(cbIncludeCumulative);
            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(_miClearCache);
            CommonFunctionality.AddToMenu(new ExecuteCommandSetQueryCachingDatabase(Activator, _configuration));
            CommonFunctionality.AddToMenu(new ExecuteCommandCreateNewQueryCacheDatabase(activator, _configuration));

            CommonFunctionality.AddToMenu(new ToolStripSeparator());
            CommonFunctionality.AddToMenu(new ExecuteCommandShowXmlDoc(activator, "CohortIdentificationConfiguration.QueryCachingServer_ID", "Query Caching"), "Help (What is Query Caching)");

            CommonFunctionality.Add(new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(activator, null).SetTarget(_configuration),
                                    "Commit Cohort",
                                    activator.CoreIconProvider.GetImage(RDMPConcept.ExtractableCohort, OverlayKind.Add));

            CohortCompilerUI1.SetDatabaseObject(activator, databaseObject);
        }
Exemple #21
0
        public ProgressUI()
        {
            InitializeComponent();
            dataGridView1.DataSource = progress;

            progress.Columns.Add("Job");
            progress.PrimaryKey = new [] { progress.Columns[0] };

            progress.Columns.Add("Count", typeof(int));
            progress.Columns.Add("Unit");
            progress.Columns.Add("Processing Time", typeof(TimeSpan));

            Timer t = new Timer();

            t.Interval = 3000;//every 3 seconds
            t.Tick    += ProcessAndClearQueuedProgressMessages;
            t.Start();

            DataGridViewCellStyle style = new DataGridViewCellStyle();

            style.Format = "N0";
            dataGridView1.Columns["Count"].DefaultCellStyle = style;

            dataGridView1.CellFormatting += dataGridView1_CellFormatting;
            _processingTimeColIndex       = dataGridView1.Columns["Processing Time"].Index;

            _information = ChecksAndProgressIcons.Information;
            _warning     = ChecksAndProgressIcons.Warning;
            _warningEx   = ChecksAndProgressIcons.WarningEx;
            _fail        = ChecksAndProgressIcons.Fail;
            _failEx      = ChecksAndProgressIcons.FailEx;

            olvSender.ImageGetter          += ImageGetter;
            olvProgressEvents.ItemActivate += olvProgressEvents_ItemActivate;
            olvProgressEvents.UseFiltering  = true;

            ddGroupBy.Items.Add("None");
            ddGroupBy.Items.Add(olvSender.Text);

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvProgressEvents, olvSender, new Guid("2731d3cb-703c-4743-96d9-f16abff1dbbf"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvProgressEvents, olvEventDate, new Guid("f3580392-e5b5-41d0-a1da-2751172d5517"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvProgressEvents, olvMessage, new Guid("d698faf6-2ff1-4f71-96e2-9a889c2e3f13"));
        }
Exemple #22
0
        private void PopulateInspectionMenu(RDMPCollectionCommonFunctionality commonFunctionality, ToolStripMenuItem inspectionMenuItem)
        {
            var databaseEntity = _o as DatabaseEntity;

            if (commonFunctionality.CheckColumnProvider != null)
            {
                if (databaseEntity != null)
                {
                    Add(new ExecuteCommandCheck(_activator, databaseEntity, commonFunctionality.CheckColumnProvider.RecordWorst), Keys.None, inspectionMenuItem);
                }

                var checkAll = new ToolStripMenuItem("Check All", null, (s, e) => commonFunctionality.CheckColumnProvider.CheckCheckables());
                checkAll.Image   = CatalogueIcons.TinyYellow;
                checkAll.Enabled = commonFunctionality.CheckColumnProvider.GetCheckables().Any();
                inspectionMenuItem.DropDownItems.Add(checkAll);
            }

            inspectionMenuItem.Enabled = inspectionMenuItem.HasDropDown;
        }
Exemple #23
0
        public DataReleaseUI()
        {
            InitializeComponent();

            AssociatedCollection = RDMPCollection.DataExport;

            tlvReleasePotentials.CanExpandGetter = CanExpandGetter;
            tlvReleasePotentials.ChildrenGetter  = ChildrenGetter;
            checkAndExecuteUI1.CommandGetter     = CommandGetter;

            olvReleaseability.AspectGetter   = Releaseability_AspectGetter;
            olvReleaseability.ImageGetter    = Releaseability_ImageGetter;
            checkAndExecuteUI1.StateChanged += CheckAndExecuteUI1OnStateChanged;

            checkAndExecuteUI1.AllowsYesNoToAll = false;

            _commonFunctionality = new RDMPCollectionCommonFunctionality();

            checkAndExecuteUI1.BackColor = Color.FromArgb(240, 240, 240);
        }
Exemple #24
0
        public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection)
        {
            SetItemActivator(activator);

            Collection = (LoadEventsTreeViewObjectCollection)collection;

            RDMPCollectionCommonFunctionality.SetupColumnSortTracking(treeView1, new Guid("ccbea22e-a784-4968-a127-7c3a55b6d281"));

            CommonFunctionality.ClearToolStrip();

            CommonFunctionality.Add(new ToolStripLabel("Filter:"));
            CommonFunctionality.Add(_tbFilterBox);
            CommonFunctionality.Add(_btnApplyFilter);

            CommonFunctionality.Add(new ToolStripSeparator());
            CommonFunctionality.Add(new ToolStripLabel("Fetch:"));
            CommonFunctionality.Add(_tbToFetch);
            CommonFunctionality.Add(_btnFetch);

            PopulateLoadHistory();
        }
Exemple #25
0
        private void PopulateTreeMenu(RDMPCollectionCommonFunctionality commonFunctionality, ToolStripMenuItem treeMenuItem)
        {
            var databaseEntity = _o as DatabaseEntity;

            if (databaseEntity != null)
            {
                if (databaseEntity.Equals(_args.CurrentlyPinnedObject))
                {
                    Add(new ExecuteCommandUnpin(_activator, databaseEntity), Keys.None, treeMenuItem);
                }
                else
                {
                    Add(new ExecuteCommandPin(_activator, databaseEntity), Keys.None, treeMenuItem);
                }
            }

            if (_args.Tree != null && !commonFunctionality.Settings.SuppressChildrenAdder)
            {
                Add(new ExecuteCommandExpandAllNodes(_activator, commonFunctionality, _args.Model), Keys.None, treeMenuItem);
                Add(new ExecuteCommandCollapseChildNodes(_activator, commonFunctionality, _args.Model), Keys.None, treeMenuItem);
            }
            treeMenuItem.Enabled = treeMenuItem.HasDropDown;
        }
Exemple #26
0
        public LoadDiagramUI()
        {
            InitializeComponent();

            tlvLoadedTables.CanExpandGetter   += CanExpandGetter;
            tlvLoadedTables.ChildrenGetter    += ChildrenGetter;
            olvName.ImageGetter               += ImageGetter;
            tlvLoadedTables.CellToolTipGetter += CellToolTipGetter;
            olvDataType.AspectGetter           = olvDataType_AspectGetter;

            olvState.AspectGetter = olvState_AspectGetter;

            tlvLoadedTables.UseCellFormatEvents = true;
            tlvLoadedTables.FormatCell         += tlvLoadedTables_FormatCell;
            tlvLoadedTables.ItemActivate       += tlvLoadedTables_ItemActivate;

            AssociatedCollection = RDMPCollection.DataLoad;

            _btnFetchData.Click += btnFetch_Click;

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvLoadedTables, olvName, new Guid("d9fa87d8-537b-4d5c-8135-203b5790d8e5"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvLoadedTables, olvState, new Guid("9bc71a44-5a59-4a6c-8a97-efc512dc23bf"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvLoadedTables, olvDataType, new Guid("4cd3b1c5-c705-433c-a6b4-5ffd3a9b3ede"));
        }
Exemple #27
0
        private void Initialize(IActivateItems activator, string initialDescription, IProject projectSpecificIfAny)
        {
            CommonFunctionality.SetItemActivator(activator);
            var cols = _tableInfo.ColumnInfos;

            var forwardEngineer = new ForwardEngineerCatalogue(_tableInfo, cols, false);

            ExtractionInformation[] eis;
            forwardEngineer.ExecuteForwardEngineering(out _catalogue, out _catalogueItems, out eis);

            tbDescription.Text = initialDescription + " (" + Environment.UserName + " - " + DateTime.Now + ")";
            tbTableName.Text   = _tableInfo.Name;
            _catalogue.SaveToDatabase();
            objectSaverButton1.SetupFor(this, (DatabaseEntity)_catalogue, activator);

            if (_binder == null)
            {
                _binder = new BinderWithErrorProviderFactory(activator);
                _binder.Bind(tbCatalogueName, "Text", _catalogue, "Name", false, DataSourceUpdateMode.OnPropertyChanged, c => c.Name);
                _binder.Bind(tbAcronym, "Text", _catalogue, "Acronym", false, DataSourceUpdateMode.OnPropertyChanged, c => c.Acronym);
                _binder.Bind(tbDescription, "Text", _catalogue, "Description", false, DataSourceUpdateMode.OnPropertyChanged, c => c.Description);
            }

            //Every CatalogueItem is either mapped to a ColumnInfo (not extractable) or a ExtractionInformation (extractable).  To start out with they are not extractable
            foreach (CatalogueItem ci in _catalogueItems)
            {
                olvColumnExtractability.AddObject(new ColPair(ci, cols.Single(col => ci.ColumnInfo_ID == col.ID)));
            }

            _extractionCategories = new object[]
            {
                NotExtractable,
                ExtractionCategory.Core,
                ExtractionCategory.Supplemental,
                ExtractionCategory.SpecialApprovalRequired,
                ExtractionCategory.Internal,
                ExtractionCategory.Deprecated
            };

            ddCategoriseMany.Items.AddRange(_extractionCategories);

            olvExtractionCategory.AspectGetter         += ExtractionCategoryAspectGetter;
            olvColumnExtractability.AlwaysGroupByColumn = olvExtractionCategory;

            olvColumnExtractability.CellEditStarting  += TlvColumnExtractabilityOnCellEditStarting;
            olvColumnExtractability.CellEditFinishing += TlvColumnExtractabilityOnCellEditFinishing;
            olvColumnExtractability.CellEditActivation = ObjectListView.CellEditActivateMode.SingleClick;

            olvIsExtractionIdentifier.AspectPutter += IsExtractionIdentifier_AspectPutter;
            olvIsExtractionIdentifier.AspectGetter += IsExtractionIdentifier_AspectGetter;


            olvIsHashOnRelease.AspectPutter += IsHashOnRelease_AspectPutter;
            olvIsHashOnRelease.AspectGetter += IsHashOnRelease_AspectGetter;

            olvColumnInfoName.ImageGetter = ImageGetter;
            olvColumnExtractability.RebuildColumns();

            if (Activator.RepositoryLocator.DataExportRepository == null)
            {
                gbProjectSpecific.Enabled = false;
            }
            else
            {
                SelectProject(projectSpecificIfAny);
                pbProject.Image = activator.CoreIconProvider.GetImage(RDMPConcept.Project);
            }

            ddIsExtractionIdentifier.Items.Add(None);
            ddIsExtractionIdentifier.Items.AddRange(olvColumnExtractability.Objects.OfType <ColPair>().ToArray());

            RDMPControlCommonFunctionality.DisableMouseWheel(ddIsExtractionIdentifier);

            CommonFunctionality.AddHelp(btnPickProject, "IExtractableDataSet.Project_ID", "Project Specific Datasets");
            CommonFunctionality.AddHelpString(btnAddToExisting, "Add to existing catalogue", "Use this option if you want to create a Catalogue which extracts from multiple tables (via a JOIN).  Once used you will still need to configure a JoinInfo between column(s) in all the tables the Catalogue draws data from.");

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvColumnExtractability, olvColumnInfoName, new Guid("86e7bf77-8829-4f72-aa47-29a30710621f"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvColumnExtractability, olvExtractionCategory, new Guid("ad106fe4-bea0-4670-9ded-61967699269f"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvColumnExtractability, olvIsExtractionIdentifier, new Guid("f9a87191-9676-4c86-a292-608dc95e8eef"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvColumnExtractability, olvIsHashOnRelease, new Guid("d3590a68-ee78-40c6-b073-eea32cac49ec"));
        }
Exemple #28
0
        public SelectDialog(IBasicActivateItems activator, IEnumerable <T> toSelectFrom, bool allowSelectingNULL, bool allowDeleting)
        {
            _activator     = activator;
            _allowDeleting = allowDeleting;
            InitializeComponent();

            taskDescriptionLabel1.Visible = false;

            //start at cancel so if they hit the X nothing is selected
            DialogResult = DialogResult.Cancel;

            olvID.AspectGetter = (m) => (m as IMapsDirectlyToDatabaseTable)?.ID ?? null;

            // don't add the ID column if we aren't talking about database objects
            if (!typeof(IMapsDirectlyToDatabaseTable).IsAssignableFrom(typeof(T)))
            {
                olvObjects.AllColumns.Remove(olvID);
            }

            olvName.AspectGetter = (m) => m.ToString();

            olvObjects.ListFilter = new TailFilter(MaxObjectsToShow);

            olvName.ImageGetter  = GetImage;
            olvObjects.RowHeight = 19;


            if (toSelectFrom == null)
            {
                return;
            }

            if (!allowSelectingNULL)
            {
                //disable the option to select NULL
                btnSelectNULL.Visible = false;
            }

            //default to not allowing multi selection
            olvObjects.MultiSelect = false;
            btnSelect.Enabled      = false;

            //Array them
            var o = toSelectFrom.ToArray();

            //Add them to the tree view
            olvObjects.AddObjects(o);

            if (o.Length > 0 && IsBasicallyAllCatalogues(o))
            {
                splitContainer1.Panel2Collapsed              = false;
                _useCatalogueFilter                          = true;
                catalogueCollectionFilterUI1.FiltersChanged += (s, e) => ApplyFilter();
            }
            else
            {
                splitContainer1.Panel2Collapsed = true;
            }

            //If there were any
            if (o.Any())
            {
                //Set Width of the Form to accommodate all names no matter how long
                var pixelWidthofWidestText = o.Max(s => TextRenderer.MeasureText(s.ToString(), olvObjects.Font).Width);

                //But don't make it too small (smaller than the form designer shows or larger than 1000 pixels)
                this.Width = Math.Min(Math.Max(Width, 100 + pixelWidthofWidestText), 1000);
            }

            AddUsefulPropertiesIfHomogeneousTypes(o);

            // Setup olvSelected but leave it removed for now (IsVisible is problematic - especially for first columns)
            olvSelected.CheckBoxes    = true;
            olvSelected.AspectGetter += Selected_AspectGetter;
            olvSelected.AspectPutter += Selected_AspectPutter;
            olvObjects.AllColumns.Remove(olvSelected);

            olvObjects.RebuildColumns();

            MultiSelected = new HashSet <T>();

            olvSelected.GroupWithItemCountFormat         = "{0} ({1} objects)";
            olvSelected.GroupWithItemCountSingularFormat = "{0} (1 objects)";
            olvSelected.GroupKeyGetter += GroupKeyGetter;

            ApplyFilter();

            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvObjects, olvName, new Guid("298cda00-5ec8-423c-9230-71d78bec6bc4"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvObjects, olvID, new Guid("bb0fe2f0-1e73-4b00-a5b7-4b6ce3510bab"));
        }
Exemple #29
0
        public UserSettingsFileUI(IActivateItems activator)
        {
            _activator = activator;

            InitializeComponent();
            //Stop mouse wheel scroll from scrolling the combobox when it's closed to avoid the value being changed without user noticing.
            RDMPControlCommonFunctionality.DisableMouseWheel(ddWordWrap);
            RDMPControlCommonFunctionality.DisableMouseWheel(ddTheme);


            olvErrorCodes.CellEditActivation = CellEditActivateMode.SingleClick;
            olvErrorCodes.ShowGroups         = false;

            olvCode.AspectName = nameof(ErrorCode.Code);
            olvCode.Text       = "Code";
            olvCode.IsEditable = false;
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvErrorCodes, olvCode, new Guid("bba20a20-ffa2-4db6-b4fe-a5dcc5a03727"));

            olvMessage.AspectName = nameof(ErrorCode.Message);
            olvMessage.Text       = "Error Message";
            olvMessage.IsEditable = false;
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvErrorCodes, olvMessage, new Guid("21a785e9-52f4-494b-89d0-6ccc68689ce9"));

            olvTreatment.Text                 = "Treatment";
            olvTreatment.Width                = 20;
            olvTreatment.AspectGetter        += Treatment_Getter;
            olvTreatment.AspectPutter        += Treatment_Putter;
            olvTreatment.CellEditUseWholeCell = true;
            olvTreatment.IsEditable           = true;
            RDMPCollectionCommonFunctionality.SetupColumnTracking(olvErrorCodes, olvTreatment, new Guid("75d54469-f870-4870-86cf-2dd782a27f57"));

            olvErrorCodes.RebuildColumns();

            cbShowHomeOnStartup.Checked                     = UserSettings.ShowHomeOnStartup;
            cbEmphasiseOnTabChanged.Checked                 = UserSettings.EmphasiseOnTabChanged;
            cbConfirmExit.Checked                           = UserSettings.ConfirmApplicationExiting;
            cbFindShouldPin.Checked                         = UserSettings.FindShouldPin;
            cbThemeMenus.Checked                            = UserSettings.ApplyThemeToMenus;
            cbWait5Seconds.Checked                          = UserSettings.Wait5SecondsAfterStartupUI;
            cbShowCohortWizard.Checked                      = UserSettings.ShowCohortWizard;
            cbDoubleClickToExpand.Checked                   = UserSettings.DoubleClickToExpand;
            cbDebugPerformance.Checked                      = UserSettings.DebugPerformance;
            cbAllowIdentifiableExtractions.Checked          = UserSettings.AllowIdentifiableExtractions;
            cbShowPipelineCompletedPopup.Checked            = UserSettings.ShowPipelineCompletedPopup;
            cbHideEmptyTableLoadRunAudits.Checked           = UserSettings.HideEmptyTableLoadRunAudits;
            cbScoreZeroForCohortAggregateContainers.Checked = UserSettings.ScoreZeroForCohortAggregateContainers;
            cbAdvancedFindFilters.Checked                   = UserSettings.AdvancedFindFilters;
            cbIncludeZeroSeriesInGraphs.Checked             = UserSettings.IncludeZeroSeriesInGraphs;
            tbCreateDatabaseTimeout.Text                    = UserSettings.CreateDatabaseTimeout.ToString();
            tbArchiveTriggerTimeout.Text                    = UserSettings.ArchiveTriggerTimeout.ToString();
            tbTooltipAppearDelay.Text                       = UserSettings.TooltipAppearDelay.ToString();

            AddTooltip(cbShowHomeOnStartup, nameof(UserSettings.ShowHomeOnStartup));
            AddTooltip(cbEmphasiseOnTabChanged, nameof(UserSettings.EmphasiseOnTabChanged));
            AddTooltip(cbConfirmExit, nameof(UserSettings.ConfirmApplicationExiting));
            AddTooltip(cbFindShouldPin, nameof(UserSettings.FindShouldPin));
            AddTooltip(cbThemeMenus, nameof(UserSettings.ApplyThemeToMenus));
            AddTooltip(cbWait5Seconds, nameof(UserSettings.Wait5SecondsAfterStartupUI));
            AddTooltip(cbShowCohortWizard, nameof(UserSettings.ShowCohortWizard));
            AddTooltip(cbDoubleClickToExpand, nameof(UserSettings.DoubleClickToExpand));
            AddTooltip(cbDebugPerformance, nameof(UserSettings.DebugPerformance));
            AddTooltip(cbAllowIdentifiableExtractions, nameof(UserSettings.AllowIdentifiableExtractions));
            AddTooltip(cbShowPipelineCompletedPopup, nameof(UserSettings.ShowPipelineCompletedPopup));
            AddTooltip(cbHideEmptyTableLoadRunAudits, nameof(UserSettings.HideEmptyTableLoadRunAudits));
            AddTooltip(cbScoreZeroForCohortAggregateContainers, nameof(UserSettings.ScoreZeroForCohortAggregateContainers));
            AddTooltip(cbAdvancedFindFilters, nameof(UserSettings.AdvancedFindFilters));
            AddTooltip(cbIncludeZeroSeriesInGraphs, nameof(UserSettings.IncludeZeroSeriesInGraphs));
            AddTooltip(label7, nameof(UserSettings.CreateDatabaseTimeout));
            AddTooltip(tbCreateDatabaseTimeout, nameof(UserSettings.CreateDatabaseTimeout));
            AddTooltip(label13, nameof(UserSettings.ArchiveTriggerTimeout));
            AddTooltip(tbArchiveTriggerTimeout, nameof(UserSettings.ArchiveTriggerTimeout));
            AddTooltip(tbTooltipAppearDelay, nameof(UserSettings.TooltipAppearDelay));
            AddTooltip(label4, nameof(UserSettings.WrapMode));
            AddTooltip(ddWordWrap, nameof(UserSettings.WrapMode));
            AddTooltip(ddTheme, nameof(UserSettings.Theme));
            AddTooltip(label2, nameof(UserSettings.Theme));
            AddTooltip(label5, nameof(UserSettings.HeatMapColours));
            AddTooltip(tbHeatmapColours, nameof(UserSettings.HeatMapColours));


            olvErrorCodes.AddObjects(ErrorCodes.KnownCodes);

            ddTheme.DataSource = new []
            {
                "ResearchDataManagementPlatform.Theme.MyVS2015BlueTheme",
                "ResearchDataManagementPlatform.Theme.MyVS2015DarkTheme",
                "ResearchDataManagementPlatform.Theme.MyVS2015LightTheme"
            };

            ddTheme.SelectedItem = UserSettings.Theme;

            ddWordWrap.DataSource   = Enum.GetValues(typeof(WrapMode));
            ddWordWrap.SelectedItem = (WrapMode)UserSettings.WrapMode;

            tbHeatmapColours.Text = UserSettings.HeatMapColours;

            _bLoaded = true;

            var cmd = new ExecuteCommandClearFavourites(activator);

            btnClearFavourites.Enabled = !cmd.IsImpossible;

            btnClearFavourites.Click += (s, e) =>
            {
                cmd.Execute();
                btnClearFavourites.Enabled = !cmd.IsImpossible;
            };
        }
Exemple #30
0
        public void AddCommonMenuItems(RDMPCollectionCommonFunctionality commonFunctionality)
        {
            var deletable      = _o as IDeleteable;
            var nameable       = _o as INamed;
            var databaseEntity = _o as DatabaseEntity;

            var treeMenuItem       = AddMenuIfNotExists(Tree);
            var inspectionMenuItem = AddMenuIfNotExists(Inspection);

            //ensure all submenus appear in the same place
            foreach (var mi in _subMenuDictionary.Values)
            {
                Items.Add(mi);
            }

            //add plugin menu items
            foreach (var plugin in _activator.PluginUserInterfaces)
            {
                try
                {
                    ToolStripMenuItem[] toAdd = plugin.GetAdditionalRightClickMenuItems(_o);

                    if (toAdd != null && toAdd.Any())
                    {
                        Items.AddRange(toAdd);
                    }
                }
                catch (Exception ex)
                {
                    _activator.GlobalErrorCheckNotifier.OnCheckPerformed(new CheckEventArgs(ex.Message,
                                                                                            CheckResult.Fail, ex));
                }
            }

            if (Items.Count > 0)
            {
                Items.Add(new ToolStripSeparator());
            }

            //add delete/rename etc
            if (deletable != null)
            {
                if (_args.Masquerader is IDeleteable)
                {
                    deletable = (IDeleteable)_args.Masquerader;
                }

                Add(new ExecuteCommandDelete(_activator, deletable), Keys.Delete);
            }

            if (nameable != null)
            {
                Add(new ExecuteCommandRename(_activator, nameable), Keys.F2);
            }

            //add seldom used submenus (pin, view dependencies etc)
            Items.Add(inspectionMenuItem);
            PopulateInspectionMenu(commonFunctionality, inspectionMenuItem);

            Items.Add(treeMenuItem);
            PopulateTreeMenu(commonFunctionality, treeMenuItem);

            //add refresh and then finally help
            if (databaseEntity != null)
            {
                //if it is a masquerader add a goto the object
                if (_args.Masquerader != null)
                {
                    AddGoTo(databaseEntity, databaseEntity.GetType().Name);
                }

                Add(new ExecuteCommandRefreshObject(_activator, databaseEntity), Keys.F5);
            }


            Add(new ExecuteCommandShowKeywordHelp(_activator, _args));
        }