public PopulationAnalysisFieldsView(IImageListRetriever imageListRetriever, IToolTipCreator toolTipCreator)
        {
            _toolTipCreator    = toolTipCreator;
            _toolTipController = new ToolTipController();
            _toolTipController.Initialize(imageListRetriever);

            InitializeComponent();
            _gridViewBinder          = new GridViewBinder <PopulationAnalysisFieldDTO>(gridView);
            gridView.AllowsFiltering = false;
            gridView.OptionsSelection.EnableAppearanceFocusedRow = true;
            gridControl.ToolTipController = _toolTipController;

            //this makes sure that the field is not in edit mode as soon as we click on the field. This is required for a nice user experience with popup
            gridView.EditorShowMode = EditorShowMode.Click;
            PopupBarManager         = new BarManager {
                Form = this, Images = imageListRetriever.AllImagesForContextMenu
            };

            _colorRepository           = new UxRepositoryItemColorPickEditWithHistory(gridView);
            _unitComboBoxRepository    = new UxRepositoryItemComboBox(gridView);
            _scalingComboBoxRepository = new UxRepositoryItemComboBox(gridView);
            _removeField = createEditAndRemoveRepo();
            _removeField.Buttons[_editButtonIndex].Enabled = false;
            _editGroupAndRemoveField = createEditAndRemoveRepo();

            _repositoryItemDisabled = new RepositoryItemTextEdit {
                Enabled = false, ReadOnly = true
            };
            _repositoryItemDisabled.CustomDisplayText += (o, e) => OnEvent(customDisplayText, e);

            _scalingComboBoxRepository.FillComboBoxRepositoryWith(EnumHelper.AllValuesFor <Scalings>());
            gridView.ShowingEditor             += (o, e) => OnEvent(showingEditor, e);
            gridView.CustomDrawEmptyForeground += (o, e) => OnEvent(addMessageInEmptyArea, e);
        }
 public void UpdatePathColumnsVisibility()
 {
     if (!AutomaticallyHideEmptyColumns)
     {
         return;
     }
     EnumHelper.AllValuesFor <PathElement>().Each(updateColumnVisibility);
 }
Example #3
0
        public void Refresh()
        {
            _allLinkedParameters.Clear();
            _allLinkedParameters.AddRange(allExistingLinkedParametersFrom(_identificationParameter));

            rebind();
            EnumHelper.AllValuesFor <PathElement>().Each(updateColumnVisibility);
        }
        public void Edit(IEnumerable <IParameter> parameters)
        {
            releaseParameters();

            EditedParameters = parameters;
            _parameterDTOs.AddRange(EditedParameters.MapAllUsing(_parameterDTOMapper).Cast <ParameterDTO>());

            _view.BindTo(_parameterDTOs);

            EnumHelper.AllValuesFor <PathElementId>().Each(updateColumnVisibility);
        }
Example #5
0
        public UxLineStylesComboBoxRepository(BaseView view, bool removeLineStyleNone = false) : base(view)
        {
            var allLineStyles = EnumHelper.AllValuesFor <LineStyles>().ToList();

            if (removeLineStyleNone)
            {
                allLineStyles.Remove(LineStyles.None);
            }

            this.FillComboBoxRepositoryWith(allLineStyles);
        }
        public override void InitializeBinding()
        {
            _lineStyleRepository.FillComboBoxRepositoryWith(EnumHelper.AllValuesFor <LineStyles>());
            _lineThicknessRepository.FillComboBoxRepositoryWith(new[] { 1, 2, 3 });
            _symbolRepository.FillComboBoxRepositoryWith(EnumHelper.AllValuesFor <Symbols>());

            _gridViewBinder.AutoBind(x => x.Name)
            .WithCaption(Captions.CurveName);

            _gridViewBinder.AutoBind(x => x.xRepositoryName)
            .WithCaption(Captions.XRepositoryName);

            _gridViewBinder.AutoBind(x => x.xDataPath)
            .WithCaption(Captions.XDataPath);

            _gridViewBinder.AutoBind(x => x.xQuantityType)
            .WithRepository(x => _quantityTypeRepository)
            .WithCaption(Captions.XQuantityType);

            _gridViewBinder.AutoBind(x => x.yRepositoryName)
            .WithCaption(Captions.YRepositoryName);

            _gridViewBinder.AutoBind(x => x.yDataPath)
            .WithCaption(Captions.YDataPath);

            _gridViewBinder.AutoBind(x => x.yQuantityType)
            .WithRepository(x => _quantityTypeRepository)
            .WithCaption(Captions.YQuantityType);

            _gridViewBinder.AutoBind(x => x.Color)
            .WithRepository(x => _colorRepository);

            _gridViewBinder.AutoBind(x => x.LineStyle)
            .WithRepository(x => _lineStyleRepository);

            _gridViewBinder.AutoBind(x => x.LineThickness)
            .WithRepository(x => _lineThicknessRepository);

            _gridViewBinder.AutoBind(x => x.Symbol)
            .WithRepository(x => _symbolRepository);

            _gridViewBinder.AutoBind(x => x.Visible);

            _gridViewBinder.AddUnboundColumn()
            .WithCaption(UIConstants.EMPTY_COLUMN)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH * _buttonRepository.Buttons.Count)
            .WithRepository(getButtonRepository);

            _gridViewBinder.Changed += NotifyViewChanged;

            _buttonRepository.ButtonClick += (o, e) => OnEvent(buttonClick, e, notifyViewChanged: true);
        }
Example #7
0
        protected bool Equals(BaseDimensionRepresentation other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(EnumHelper.AllValuesFor <BaseDimension>().All(x => Exponent(x) == other.Exponent(x)));
        }
Example #8
0
        public override void InitializeBinding()
        {
            _interpolationModeRepository.FillComboBoxRepositoryWith(EnumHelper.AllValuesFor <InterpolationModes>());
            _interpolationModeRepository.TextEditStyle = TextEditStyles.DisableTextEditor;
            _lineStyleRepository.FillComboBoxRepositoryWith(EnumHelper.AllValuesFor <LineStyles>());
            _lineThicknessRepository.FillComboBoxRepositoryWith(new[] { 1, 2, 3 });
            _symbolRepository.FillComboBoxRepositoryWith(EnumHelper.AllValuesFor <Symbols>());
            _axisTypeRepository.FillComboBoxRepositoryWith(EnumHelper.AllValuesFor <AxisTypes>());
            _axisTypeRepository.Items.Remove(AxisTypes.X);

            _colName = createFor(curve => curve.Name, CurveOptionsColumns.Name);

            _xDataColumn = createFor(curve => curve.xData, CurveOptionsColumns.xData)
                           .AsReadOnly();

            _yDataColumn = createFor(curve => curve.yData, CurveOptionsColumns.yData)
                           .WithFormat(c => new DataColumnFormatter(_presenter))
                           .AsReadOnly();

            createFor(curve => curve.yAxisType, CurveOptionsColumns.yAxisType, _axisTypeRepository)
            .WithEditorConfiguration(configureAxisTypeEditor);

            createFor(curve => curve.InterpolationMode, CurveOptionsColumns.InterpolationMode, _interpolationModeRepository);

            _colorColumn = createFor(curve => curve.Color, CurveOptionsColumns.Color, _colorRepository);

            createFor(curve => curve.LineStyle, CurveOptionsColumns.LineStyle, _lineStyleRepository);

            createFor(curve => curve.Symbol, CurveOptionsColumns.Symbol, _symbolRepository);

            createFor(curve => curve.LineThickness, CurveOptionsColumns.LineThickness, _lineThicknessRepository);

            createFor(curve => curve.Visible, CurveOptionsColumns.Visible, _visibleRepository);

            createFor(curve => curve.VisibleInLegend, CurveOptionsColumns.VisibleInLegend, _visibleRepository);

            createFor(curve => curve.ShowLLOQ, CurveOptionsColumns.ShowLowerLimitOfQuantification, _showLowerLimitOfQuantificationRepository);

            var legendIndexColumn = _gridBinderCurves.Bind(curve => curve.LegendIndex);

            legendIndexColumn.Visible = false;
            gridView.Columns[legendIndexColumn.ColumnName].SortOrder = ColumnSortOrder.Ascending;

            //Delete-column
            _gridBinderCurves.AddUnboundColumn()
            .WithCaption(UIConstants.EMPTY_COLUMN)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(curve => _deleteButtonRepository)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH);
        }
Example #9
0
        public void StartComparison(IObjectBase leftObject, IObjectBase rightObject, string leftCaption, string rightCaption, ComparerSettings comparerSettings)
        {
            var diffReport = _objectComparer.Compare(leftObject, rightObject, comparerSettings);

            _view.LeftCaption  = leftCaption;
            _view.RightCaption = rightCaption;
            _allDiffItemDTO    = diffReport.Select(mapFrom).ToList();
            _view.BindTo(_allDiffItemDTO);
            EnumHelper.AllValuesFor <PathElement>().Each(updateColumnVisibility);

            //Always hide name
            _view.SetVisibility(PathElement.Name, visible: false);
            _view.DifferenceTableVisible = _allDiffItemDTO.Any();
        }
Example #10
0
        public override void Edit(IEnumerable <IParameter> parameters)
        {
            base.Edit(parameters);
            AllParametersDTO.Clear();
            AllParametersDTO.AddRange(_visibleParameters.MapAllUsing(_parameterDTOMapper).Cast <ParameterDTO>());

            _view.DistributionVisible = AllParametersDTO.Any(ParameterIsDistributed);

            EnumHelper.AllValuesFor <PathElement>().Each(updateColumnVisibility);
            updateCategoryVisibility();

            _scaleParametersPresenter.Enabled = _visibleParameters.Any(x => x.Editable);
            _view.BindTo(AllParametersDTO);

            PerformDefaultGrouping(_visibleParameters);
        }
        public PopulationStatisticalAnalysis CreateStatisticalAnalysis()
        {
            var statisticalAnalysis = new PopulationStatisticalAnalysis {
                TimeUnit = _displayUnitRetriever.PreferredUnitFor(_dimensionRepository.Time)
            };

            //add predefined single curve selection
            EnumHelper.AllValuesFor <StatisticalAggregationType>()
            .Each(x => statisticalAnalysis.AddStatistic(new PredefinedStatisticalAggregation {
                Method = x
            }));

            CoreConstants.DEFAULT_STATISTIC_PERCENTILES.Each(p => statisticalAnalysis.AddStatistic(new PercentileStatisticalAggregation {
                Percentile = p
            }));

            return(statisticalAnalysis);
        }
Example #12
0
        public EditParameterPresenter(IEditParameterView view,
                                      IEditFormulaPresenter editValueFormulaPresenter,
                                      IParameterToParameterDTOMapper parameterMapper,
                                      IEditFormulaPresenter editRhsFormulaPresenter,
                                      IInteractionTaskContext interactionTaskContext,
                                      IGroupRepository groupRepository,
                                      IEditTaskFor <IParameter> editTasks,
                                      IInteractionTasksForParameter parameterTask,
                                      IContextSpecificReferencesRetriever contextSpecificReferencesRetriever,
                                      IFavoriteTask favoriteTask,
                                      IEditValueOriginPresenter editValueOriginPresenter,
                                      ITagsPresenter tagsPresenter,
                                      IDescriptorConditionListPresenter <IParameter> containerCriteriaPresenter)
            : base(view)
        {
            _editValueFormulaPresenter          = editValueFormulaPresenter;
            _parameterTask                      = parameterTask;
            _contextSpecificReferencesRetriever = contextSpecificReferencesRetriever;
            _favoriteTask               = favoriteTask;
            _editValueOriginPresenter   = editValueOriginPresenter;
            _tagsPresenter              = tagsPresenter;
            _containerCriteriaPresenter = containerCriteriaPresenter;
            _parameterMapper            = parameterMapper;
            _groupRepository            = groupRepository;
            _editTasks = editTasks;
            _editRHSFormulaPresenter = editRhsFormulaPresenter;
            _interactionTaskContext  = interactionTaskContext;
            _view.SetFormulaView(_editValueFormulaPresenter.BaseView);
            _view.AddRHSView(_editRHSFormulaPresenter.BaseView);
            _view.AddValueOriginView(_editValueOriginPresenter.BaseView);
            _view.AddTagsView(_tagsPresenter.BaseView);

            AddSubPresenters(editRhsFormulaPresenter, editValueFormulaPresenter, _editValueOriginPresenter, _tagsPresenter, _containerCriteriaPresenter);

            _editRHSFormulaPresenter.IsRHS = true;
            _editRHSFormulaPresenter.RemoveAllFormulaTypes();
            _editRHSFormulaPresenter.AddFormulaType <ConstantFormula>();
            _editRHSFormulaPresenter.AddFormulaType <ExplicitFormula>();
            _editRHSFormulaPresenter.SetDefaultFormulaType <ExplicitFormula>();
            ParameterBuildModes   = EnumHelper.AllValuesFor <ParameterBuildMode>();
            WarnOnBuildModeChange = true;
            _editValueOriginPresenter.ValueOriginUpdated += setValueOrigin;
            _editValueOriginPresenter.ShowCaption         = false;
        }
        public void ReloadMenus()
        {
            ChartEditorPresenter.ClearButtons();
            var saveAsTemplate = new TestProgramButton("Save as Chart Template", onChartSave);

            ChartEditorPresenter.AddButton(saveAsTemplate);


            var groupMenu = CreateSubMenu.WithCaption("Layouts");

            EnumHelper.AllValuesFor <Layouts>().Each(
                layout => groupMenu.AddItem(new TestProgramButton(layout.ToString(), onLayouts)));

            groupMenu.AddItem(new TestProgramButton("Dummy", () => { }).AsGroupStarter());

            ChartEditorPresenter.AddButton(groupMenu);

            ChartEditorPresenter.AddUsedInMenuItem();

            ChartEditorPresenter.AddChartTemplateMenu(_simulationSettings, template => loadFromTemplate(template));
        }
Example #14
0
        private DevExpressAxis retrieveAxisView()
        {
            if (AxisType == AxisTypes.X)
            {
                return(xyDiagram.AxisX);
            }

            if (AxisType == AxisTypes.Y)
            {
                return(xyDiagram.AxisY);
            }

            int       axisTypeIndex       = (int)AxisType;
            const int secondaryAxisOffset = (int)AxisTypes.Y2;

            // create yN-Axis, if necessary, and also the preceding yN-Axes
            for (int i = xyDiagram.SecondaryAxesY.Count; i <= axisTypeIndex - secondaryAxisOffset; i++)
            {
                var typeOfAxisView = EnumHelper.AllValuesFor <AxisTypes>().ElementAt(i + secondaryAxisOffset);
                var secondaryAxisY = new SecondaryAxisY(typeOfAxisView.ToString());
                xyDiagram.SecondaryAxesY.Add(secondaryAxisY);
            }
            return(xyDiagram.SecondaryAxesY[axisTypeIndex - secondaryAxisOffset]);
        }
 public IEnumerable <IntracellularVascularEndoLocation> AllIntracellularVascularEndoLocations()
 {
     return(EnumHelper.AllValuesFor <IntracellularVascularEndoLocation>());
 }
Example #16
0
 public IEnumerable <AxisCountMode> AllScalingModes()
 {
     return(EnumHelper.AllValuesFor <AxisCountMode>());
 }
Example #17
0
 public IEnumerable <BarType> AllBarTypes()
 {
     return(EnumHelper.AllValuesFor <BarType>());
 }
Example #18
0
 public IEnumerable <Scalings> AllScalings()
 {
     return(EnumHelper.AllValuesFor <Scalings>());
 }
Example #19
0
 public IEnumerable <PopulationAnalysisType> AllPopulationAnalyses()
 {
     return(EnumHelper.AllValuesFor <PopulationAnalysisType>());
 }
Example #20
0
 public IEnumerable <LineStyles> GetValidValues()
 {
     return(EnumHelper.AllValuesFor <LineStyles>());
 }
 public IEnumerable <SearchScope> GetScopes()
 {
     return(EnumHelper.AllValuesFor <SearchScope>());
 }
Example #22
0
 private IEnumerable <Scalings> getAllScalings(ChartOptions arg)
 {
     return(EnumHelper.AllValuesFor <Scalings>());
 }
Example #23
0
 public IEnumerable <ReportSettings.ReportFont> AvailableFonts()
 {
     return(EnumHelper.AllValuesFor <ReportSettings.ReportFont>());
 }
Example #24
0
 public IEnumerable <AxisTypes> GetValidValues()
 {
     return(EnumHelper.AllValuesFor <AxisTypes>().Where(axisType => axisType != AxisTypes.X));
 }
Example #25
0
 private IEnumerable <TemplateType> allPrimitiveTypes()
 {
     return(EnumHelper.AllValuesFor <TemplateType>());
 }
 public IEnumerable <TissueLocation> AllTissueLocations()
 {
     return(EnumHelper.AllValuesFor <TissueLocation>());
 }
 public void should_throw_an_exception()
 {
     The.Action(() => EnumHelper.AllValuesFor <AnImplementation>()).ShouldThrowAn <ArgumentException>();
 }
 public void should_return_all_values_in_the_accurate_order()
 {
     EnumHelper.AllValuesFor <TestEnum>().ShouldOnlyContainInOrder(TestEnum.Value1, TestEnum.Value2);
 }
Example #29
0
 public IEnumerable <Symbols> GetValidValues()
 {
     return(EnumHelper.AllValuesFor <Symbols>());
 }
 public IEnumerable <DistributionFormulaType> AllFormulaTypes()
 {
     return(EnumHelper.AllValuesFor <DistributionFormulaType>());
 }