public AggregateTopXUI() { InitializeComponent(); //Stop mouse wheel scroll from scrolling the combobox when it's closed to avoid the value being changed without user noticing. RDMPControlCommonFunctionality.DisableMouseWheel(ddAscOrDesc); RDMPControlCommonFunctionality.DisableMouseWheel(ddOrderByDimension); }
public ArgumentValueComboBoxUI(IActivateItems activator, object[] objectsForComboBox) { _activator = activator; _objectsForComboBox = objectsForComboBox; InitializeComponent(); //Stop mouse wheel scroll from scrolling the combobox when it's closed to avoid the value being changed without user noticing. RDMPControlCommonFunctionality.DisableMouseWheel(cbxValue); if (objectsForComboBox == null || objectsForComboBox.Length == 0) { return; } btnPick.Enabled = objectsForComboBox.All(o => o is IMapsDirectlyToDatabaseTable); //If it is a dropdown of Types if (objectsForComboBox.All(o => o is Type)) { //add only the names (not the full namespace) types = new HashSet <Type>(objectsForComboBox.Cast <Type>()); cbxValue.DropDownStyle = ComboBoxStyle.DropDownList; cbxValue.Items.AddRange(types.Select(t => t.Name).ToArray()); cbxValue.Items.Add(ClearSelection); } else if (objectsForComboBox.All(t => t is Enum)) //don't offer "ClearSelection" if it is an Enum list { _isEnum = true; cbxValue.DataSource = objectsForComboBox; cbxValue.DropDownStyle = ComboBoxStyle.DropDownList; } else { cbxValue.DropDownStyle = ComboBoxStyle.DropDownList; cbxValue.DropDown += (s, e) => { LateLoad(objectsForComboBox); }; } }
//Constructor public AggregateEditorUI() { InitializeComponent(); //Stop mouse wheel scroll from scrolling the combobox when it's closed to avoid the value being changed without user noticing. RDMPControlCommonFunctionality.DisableMouseWheel(ddAxisDimension); RDMPControlCommonFunctionality.DisableMouseWheel(ddPivotDimension); if (VisualStudioDesignMode) { return; } olvJoin.CheckStateGetter += ForceJoinCheckStateGetter; olvJoin.CheckStatePutter += ForceJoinCheckStatePutter; olvJoinTableName.ImageGetter += ImageGetter; olvJoinDirection.AspectGetter += JoinDirectionGetter; olvJoinDirection.AspectPutter += JoinDirectionPutter; olvJoin.AddDecoration(new EditingCellBorderDecoration { UseLightbox = true }); }
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")); }
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; }; }