public override void InitializeBinding()
        {
            base.InitializeBinding();
            _colName = _gridViewBinder.Bind(x => x.Name)
                       .WithCaption(Captions.Name)
                       .WithOnValueUpdating((o, e) => OnEvent(() => _presenter.ChangeName(o, e.NewValue)));

            _colName.XtraColumn.SortMode  = ColumnSortMode.Value;
            _colName.XtraColumn.SortOrder = ColumnSortOrder.Ascending;

            _gridViewBinder.Bind(x => x.NumberOfSteps)
            .WithCaption(Captions.SensitivityAnalysis.NumberOfSteps)
            .WithToolTip(Captions.SensitivityAnalysis.NumberOfStepsDescription)
            .WithFormat(x => x.NumberOfStepsParameter.IntParameterFormatter())
            .WithEditorConfiguration((activeEditor, dto) => _comboBoxUnit.UpdateUnitsFor(activeEditor, dto.NumberOfStepsParameter))
            .OnValueUpdating += (dto, valueInGuiUnit) => setParameterValue(dto.NumberOfStepsParameter, valueInGuiUnit.NewValue);

            _gridViewBinder.Bind(x => x.VariationRange)
            .WithCaption(Captions.SensitivityAnalysis.VariationRange)
            .WithToolTip(Captions.SensitivityAnalysis.VariationRangeDescription)
            .WithFormat(x => x.NumberOfStepsParameter.ParameterFormatter())
            .WithEditorConfiguration((activeEditor, dto) => _comboBoxUnit.UpdateUnitsFor(activeEditor, dto.VariationRangeParameter))
            .OnValueUpdating += (dto, valueInGuiUnit) => setParameterValue(dto.VariationRangeParameter, valueInGuiUnit.NewValue);

            _gridViewBinder.AddUnboundColumn()
            .WithCaption(UIConstants.EMPTY_COLUMN)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(x => _removeButtonRepository)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH);

            _gridViewBinder.Changed             += NotifyViewChanged;
            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.RemoveSensitivityParameter(_gridViewBinder.FocusedElement));
            btnRemoveAll.Click    += (o, e) => OnEvent(() => _presenter.RemoveAllParameters());
            gridView.HiddenEditor += (o, e) => { _comboBoxUnit.Visible = false; };
        }
示例#2
0
        public override void InitializeBinding()
        {
            _colName = _gridViewBinder.Bind(x => x.Name)
                       .WithCaption(PKSimConstants.UI.Experiment)
                       .WithRepository(dto => _nameRepository)
                       .WithShowButton(ShowButtonModeEnum.ShowAlways);

            _nameRepository.ButtonClick += (o, e) => OnEvent(() => nameButtonsClick(_gridViewBinder.FocusedElement));

            _valueOriginBinder.InitializeBinding(_gridViewBinder, updateValueOrigin);

            var colDefault = _gridViewBinder.Bind(x => x.IsDefault)
                             .WithCaption(PKSimConstants.UI.IsDefault)
                             .WithRepository(dto => _isDefaultRepository)
                             .WithFixedWidth(UIConstants.Size.EMBEDDED_CHECK_BOX_WIDTH);

            colDefault.OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetIsDefaultFor(o, e.NewValue));
            _colDefault = colDefault;

            _colButtons = _gridViewBinder.AddUnboundColumn()
                          .WithCaption(PKSimConstants.UI.EmptyColumn)
                          .WithShowButton(ShowButtonModeEnum.ShowAlways)
                          .WithRepository(GetButtonRepository)
                          .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2);

            _addAndRemoveButtonRepository.ButtonClick += (o, e) => OnEvent(() => buttonRepositoryButtonClick(e, _gridViewBinder.FocusedElement));
            _addButtonRepository.ButtonClick          += (o, e) => OnEvent(() => _presenter.AddAlternative());

            //last but not least: Set the column for name as the first column in the grid view
            _colName.XtraColumn.VisibleIndex = 0;
        }
        public override void InitializeBinding()
        {
            //use autobind to enable automatic notification
            _colMinimum = _gridViewBinder.AutoBind(x => x.Minimum);
            _colMaximum = _gridViewBinder.AutoBind(x => x.Maximum)
                          .WithOnValueUpdating((o, e) => OnEvent(() => maximumValueChanged(o, e.NewValue)));

            _gridViewBinder.AutoBind(x => x.Label);
            _gridViewBinder.AutoBind(x => x.Color)
            .WithRepository(x => _colorRepository);
            _gridViewBinder.AutoBind(x => x.Symbol)
            .WithRepository(x => _symbolsRepository)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);

            _gridViewBinder.AddUnboundColumn()
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(getButtonRepository)
            .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2);

            _addButtonRepository.ButtonClick          += (o, e) => OnEvent(addFixedLimit);
            _addAndRemoveButtonRepository.ButtonClick += (o, e) => OnEvent(addOrRemoveFixedLimit, e);

            _gridViewBinder.Changed += NotifyViewChanged;
        }
示例#4
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            _screenBinder.Bind(dto => dto.UseDerivedValues)
            .To(chkUseDerivedValues)
            .OnValueUpdating += setUseDerivedValues;

            _colX = _gridBinder.AutoBind(dto => dto.XValue)
                    .WithFormat(dto => dto.ValuePointXFormatter())
                    .WithToolTip(ToolTips.Formula.X)
                    .WithOnValueUpdating((o, e) => OnEvent(() => onXValueSet(o, e.NewValue)));

            _colY = _gridBinder.AutoBind(dto => dto.YValue)
                    .WithFormat(dto => dto.ValuePointYFormatter())
                    .WithToolTip(ToolTips.Formula.Y)
                    .WithOnValueUpdating((o, e) => OnEvent(() => onYValueSet(o, e.NewValue)));

            _colRestartSolver = _gridBinder.Bind(dto => dto.RestartSolver)
                                .WithRepository(dto => _uxRepositoryItemCheckEdit)
                                .WithToolTip(ToolTips.Formula.RestartSolver)
                                .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_CHECK_BOX_WIDTH)
                                .WithOnValueUpdating((o, e) => OnEvent(() => setRestartSolver(o, e.NewValue)));

            var buttonRepository = createButtonRepository();

            _colButtons = _gridBinder.AddUnboundColumn().WithRepository(dto => buttonRepository)
                          .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN)
                          .WithFixedWidth(2 * OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH)
                          .WithShowButton(ShowButtonModeEnum.ShowAlways);

            btnAddValuePoint.Click    += (o, e) => OnEvent(_presenter.AddValuePoint);
            gridView.PopupMenuShowing += (o, e) => OnEvent(onPopUpMenuShowing, e);
            gridView.RowCountChanged  += (o, e) => OnEvent(() => buttonRepository.Buttons[1].Enabled = _presenter.ShouldEnableDelete());
        }
        public override void InitializeBinding()
        {
            var createFormulationButton = createdFormulationButtonRepository();
            var loadFormulationButton   = loadFormulationButtonRepository();


            _formulationKeyColumn = _gridViewBinder.Bind(x => x.FormulationKey)
                                    .WithCaption(PKSimConstants.UI.PlaceholderFormulation)
                                    .AsReadOnly();

            _gridViewBinder.Bind(x => x.Route)
            .AsReadOnly();

            _gridViewBinder.AutoBind(x => x.Selection)
            .WithRepository(x => _repositoryForFormulation)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithEditorConfiguration(configureFormulation);

            _gridViewBinder.AddUnboundColumn()
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(dto => createFormulationButton);


            _gridViewBinder.AddUnboundColumn()
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH)
            .WithRepository(dto => loadFormulationButton);

            _gridViewBinder.Changed             += () => _presenter.ViewChanged();
            createFormulationButton.ButtonClick += (o, e) => OnEvent(() => _presenter.CreateFormulationFor(_gridViewBinder.FocusedElement));
            loadFormulationButton.ButtonClick   += (o, e) => OnEvent(() => _presenter.LoadFormulationFor(_gridViewBinder.FocusedElement));
        }
示例#6
0
 protected void InitializePercentileBinding()
 {
     _columnPercentile = _gridViewBinder.Bind(param => param.Percentile)
                         .WithCaption(PKSimConstants.UI.Percentile)
                         .WithRepository(getPercentileRepository)
                         .WithOnValueSet((o, e) => OnEvent(() => _presenter.SetParameterPercentile(o, e.NewValue)))
                         .AsReadOnly();
 }
示例#7
0
 private void updateColumnVisibility(IGridViewColumn column, bool visible, int visibleIndex)
 {
     column.XtraColumn.Visible = visible;
     if (visible)
     {
         column.XtraColumn.VisibleIndex = visibleIndex;
     }
 }
        public override void InitializeBinding()
        {
            //auto bind necessary to allow for error check
            var schemaButtonRepository = createAddRemoveButtonRepository();

            _screenBinder = new ScreenBinder <AdvancedProtocol>();

            _screenBinder.Bind(x => x.TimeUnit)
            .To(cbTimeUnit)
            .WithValues(x => _presenter.AllTimeUnits());

            _gridProtocolBinder = new GridViewBinder <SchemaDTO>(mainView)
            {
                ValidationMode = ValidationMode.LeavingCell,
                BindingMode    = BindingMode.OneWay
            };

            var colStartTime = _gridProtocolBinder.AutoBind(x => x.StartTime)
                               .WithCaption(PKSimConstants.UI.StartTime)
                               .WithFormat(schemaDto => schemaDto.StartTimeParameter.ParameterFormatter())
                               .WithEditorConfiguration((activeEditor, schemaDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, schemaDTO.StartTimeParameter));

            colStartTime.OnValueUpdating     += (dto, valueInGuiUnit) => setParameterValue(dto.StartTimeParameter, valueInGuiUnit.NewValue);
            colStartTime.XtraColumn.SortOrder = ColumnSortOrder.Ascending;

            _gridProtocolBinder.AutoBind(x => x.NumberOfRepetitions)
            .WithCaption(PKSimConstants.UI.NumberOfRepetitions)
            .OnValueUpdating += (dto, valueInGuiUnit) => setParameterValue(dto.NumberOfRepetitionsParameter, valueInGuiUnit.NewValue);

            _gridProtocolBinder.AutoBind(x => x.TimeBetweenRepetitions)
            .WithCaption(PKSimConstants.UI.TimeBetweenRepetitions)
            .WithFormat(schemaDto => schemaDto.TimeBetweenRepetitionsParameter.ParameterFormatter())
            .WithEditorConfiguration((activeEditor, schemaDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, schemaDTO.TimeBetweenRepetitionsParameter))
            .OnValueUpdating += (dto, valueInGuiUnit) => setParameterValue(dto.TimeBetweenRepetitionsParameter, valueInGuiUnit.NewValue);

            _gridProtocolBinder.AutoBind(x => x.EndTime)
            .WithCaption(PKSimConstants.UI.EndTime)
            .WithFormat(schemaDto => schemaDto.TimeBetweenRepetitionsParameter.ParameterFormatter())
            .AsReadOnly();

            _comboBoxUnit.ParameterUnitSet += setParameterUnit;

            _colAddRemoveSchema = _gridProtocolBinder.AddUnboundColumn()
                                  .WithCaption(PKSimConstants.UI.EmptyColumn)
                                  .WithShowButton(ShowButtonModeEnum.ShowAlways)
                                  .WithRepository(dto => schemaButtonRepository)
                                  .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2);


            _gridProtocolBinder.Changed += NotifyViewChanged;
            _screenBinder.Changed       += unitChanged;

            schemaButtonRepository.ButtonClick += (o, e) => OnEvent(() => schemaButtonRepositoryButtonClick(o, e, _gridProtocolBinder.FocusedElement));
            //Create a dummy column for the detail view to avoid auto binding to details
            gridViewSchemaItems.Columns.AddField("Dummy");
            gridViewDynamicParameters.Columns.AddField("Dummy");
            gridViewUserDefinedTarget.Columns.AddField("Dummy");
        }
示例#9
0
 protected void InitializeFavoriteBinding()
 {
     _columnFavorites = _gridViewBinder.Bind(x => x.IsFavorite)
                        .WithCaption(PKSimConstants.UI.Favorites)
                        .WithWidth(UIConstants.Size.EMBEDDED_CHECK_BOX_WIDTH)
                        .WithRepository(x => _favoriteRepository)
                        .WithToolTip(PKSimConstants.UI.FavoritesToolTip)
                        .WithOnValueUpdating((o, e) => OnEvent(() => _presenter.SetFavorite(o, e.NewValue)));
 }
 protected IGridViewColumn BindToPartialCompoundMolecule()
 {
     return(_colCompoundProcess = _gridViewPartialBinder.Bind(x => x.CompoundProcess)
                                  .WithRepository(repositoryItemForCompoundProcesses)
                                  .WithEditorConfiguration(configureCompoundProcessesRepository)
                                  .WithShowButton(ShowButtonModeEnum.ShowAlways)
                                  .WithOnValueUpdating((dto, e) => OnEvent(() => _presenter.CompoundProcessChanged(dto, e.NewValue)))
                                  .WithOnChanged(dto => OnEvent(() => _presenter.SelectionChanged(dto))));
 }
示例#11
0
        public override void InitializeBinding()
        {
            _colValue = _gridViewBinder.AutoBind(x => x.Lipophilicty)
                        .WithCaption(PKSimConstants.UI.Lipophilicity)
                        .WithFormat(dto => dto.LipophilictyParameter.ParameterFormatter())
                        .WithEditorConfiguration((editor, dto) => _comboBoxUnit.UpdateUnitsFor(editor, dto.LipophilictyParameter))
                        .WithOnValueUpdating((dto, e) => OnEvent(() => lipophilicityGroupPresenter.SetLipophilicityValue(dto, e.NewValue)));

            //to do at the end to respect order
            base.InitializeBinding();
        }
        private void initializeDirectionBinding()
        {
            _colDirection = _gridViewBinder.Bind(item => item.TransportDirection)
                            .WithRepository(getTransporterMembraneRepository)
                            .WithEditorConfiguration(editTransporterMembraneTypeRepository)
                            .WithShowButton(ShowButtonModeEnum.ShowAlways)
                            .WithCaption(PKSimConstants.UI.TransportDirection)
                            .WithOnValueUpdating((o, e) => OnEvent(() => transporterExpressionParametersPresenter.SetTransportDirection(o, e.NewValue)));

            _colDirection.XtraColumn.OptionsColumn.AllowMerge = DefaultBoolean.True;
        }
示例#13
0
 public override void InitializeBinding()
 {
     _colGrouping = _gridViewBinder.AutoBind(x => x.SimulationPathElement).AsReadOnly();
     _colGrouping.XtraColumn.GroupIndex = 0;
     _colGrouping.XtraColumn.SortMode   = ColumnSortMode.Custom;
     InitializeNameBinding();
     InitializeValueBinding();
     InitializeValueDescriptionBinding();
     InitializeFavoriteBinding();
     gridViewParameters.CustomDrawGroupRow += removeCollapseExpandIndicator;
     gridViewParameters.GroupRowCollapsing += (o, e) => { e.Allow = false; };
 }
示例#14
0
        protected override void InitializePartialBinding()
        {
            BindToPartialImage();
            BindToPartialIndividualMolecule();
            BindToPartialCompoundMolecule();

            _colMetaboliteName = _gridViewPartialBinder.Bind(x => x.MetaboliteName)
                                 .WithRepository(repositoryItemForMetabolites)
                                 .WithEditorConfiguration(configureMetabolitesRepository)
                                 .WithShowButton(ShowButtonModeEnum.ShowAlways)
                                 .WithCaption(PKSimConstants.UI.Metabolite);
        }
示例#15
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            _captionColumn = _gridViewBinder.Bind(x => x.Caption)
                             .AsReadOnly();

            _valueOriginBinder.InitializeBinding(_gridViewBinder,
                                                 (dto, valueOrigin) => _presenter.ValueOriginUpdated(valueOrigin),
                                                 dto => _presenter.ValueOriginEditable(),
                                                 defaultColumnWidth: null);
        }
示例#16
0
        public override void InitializeBinding()
        {
            _gridViewBinder.Bind(x => x.Species)
            .WithCaption(PKSimConstants.UI.Species)
            .AsReadOnly();

            _vssColumn = _gridViewBinder.Bind(x => x.VSS)
                         .WithCaption(CoreConstants.PKAnalysis.VssPhysChem)
                         .WithFormat(_doubleFormatter)
                         .AsReadOnly();

            btnCalculateVSS.Click += (o, e) => OnEvent(_presenter.CalculateVSS);
        }
示例#17
0
        public override void InitializeBinding()
        {
            var colValue = _gridViewBinder.AutoBind(x => x.Permeability)
                           .WithCaption(PKSimConstants.UI.Permeability);

            AddValueBinding(colValue);
            colValue.WithFormat(formatForAlternative);
            colValue.OnValueUpdating += (x, e) => permeabilityGroupPresenter.SetPermabilityValue(x, e.NewValue);
            _colValue = colValue;
            _comboBoxUnit.ParameterUnitSet += (dto, unit) => OnEvent(() => permeabilityGroupPresenter.SetPermabilityUnit(dto, unit));

            //to do at the end to respect order
            base.InitializeBinding();
        }
示例#18
0
        public override void InitializeBinding()
        {
            _pathElementsBinder.InitializeBinding(_gridViewBinder);
            _gridViewBinder.Bind(x => x.ObjectName)
            .WithCaption(Captions.Comparisons.ObjectName)
            .AsReadOnly();

            _gridViewBinder.Bind(x => x.Property)
            .WithCaption(Captions.Comparisons.Property)
            .AsReadOnly();

            _colValue1 = _gridViewBinder.Bind(x => x.Value1).AsReadOnly();
            _colValue2 = _gridViewBinder.Bind(x => x.Value2).AsReadOnly();
        }
示例#19
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);
        }
        private void groupByColumn(IGridViewColumn gridViewColumn, int groupIndex = 0)
        {
            if (!gridViewColumn.Visible)
            {
                return;
            }

            gridViewColumn.XtraColumn.GroupIndex = groupIndex;

            //set the first row visible
            int rowHandle = gridView.GetVisibleRowHandle(0);

            gridView.FocusedRowHandle = rowHandle;
        }
        public override void InitializeBinding()
        {
            gridViewParameters.ShowingEditor += onShowingEditor;

            _settingsBinder.Bind(x => x.Population)
            .To(lblPopulation);

            _settingsBinder.Bind(x => x.DiseaseState)
            .To(lblDiseaseState);

            _settingsBinder.Bind(x => x.Individual)
            .To(uxBuildingBlockSelection)
            .OnValueUpdating += (o, e) => _presenter.IndividualSelectionChanged(e.NewValue);

            _settingsBinder.Bind(dto => dto.NumberOfIndividuals)
            .To(tbNumberOfIndividuals);

            _settingsBinder.Bind(dto => dto.ProportionOfFemales)
            .To(tbProportionsOfFemales);

            RegisterValidationFor(_settingsBinder, NotifyViewChanged);

            _gridViewBinder.Bind(x => x.ParameterDisplayName)
            .WithCaption(PKSimConstants.UI.Parameter)
            .AsReadOnly();

            _colFrom = _gridViewBinder.AddUnboundColumn()
                       .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN)
                       .WithRepository(fromRepository).AsReadOnly();
            _colFrom.XtraColumn.MaxWidth = ScaleForScreenDPI(40);

            bindValue(x => x.MinValueInDisplayUnit);

            _colTo = _gridViewBinder.AddUnboundColumn()
                     .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN)
                     .WithRepository(toRepository).AsReadOnly();
            _colTo.XtraColumn.MaxWidth = ScaleForScreenDPI(40);

            bindValue(x => x.MaxValueInDisplayUnit);

            _colUnit = _gridViewBinder.AutoBind(x => x.Unit)
                       .WithRepository(getUnitRepository)
                       .WithEditorConfiguration(updateUnits)
                       .WithShowButton(ShowButtonModeEnum.ShowAlways);

            _gridViewBinder.Changed += NotifyViewChanged;

            btnStop.Click += (o, e) => OnEvent(_presenter.Cancel);
        }
示例#22
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            _gridViewBinder.AutoBind(x => x.Name)
            .AsReadOnly();

            var colDatabaseType = _gridViewBinder.AutoBind(x => x.DatabaseTypeDisplay)
                                  .WithRepository(templateTypeRepository)
                                  .WithCaption(PKSimConstants.UI.TemplateSource)
                                  .AsReadOnly();

            _colVersion = _gridViewBinder.AutoBind(x => x.Version)
                          .AsReadOnly();

            _colVersion.XtraColumn.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Far;

            _colQualified = _gridViewBinder.AutoBind(x => x.Qualified)
                            .WithCaption(PKSimConstants.UI.OSPLibraryRelease)
                            .WithFormat(_booleanFormatter)
                            .AsReadOnly();

            _colQualified.XtraColumn.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;

            _colUrl = _gridViewBinder.AutoBind(x => x.Url)
                      .WithCaption(PKSimConstants.UI.Url)
                      .WithRepository(x => _urlRepository);

            var colDescription = _gridViewBinder.AutoBind(x => x.Description)
                                 .AsReadOnly();

            _colButtons = _gridViewBinder.AddUnboundColumn()
                          .WithCaption(PKSimConstants.UI.EmptyColumn)
                          .WithShowButton(ShowButtonModeEnum.ShowAlways)
                          .WithRepository(repositoryForTemplate)
                          .WithFixedWidth(EMBEDDED_BUTTON_WIDTH * 2);

            gridView.PreviewFieldName             = colDescription.PropertyName;
            colDescription.Visible                = false;
            colDatabaseType.XtraColumn.GroupIndex = 0;

            _editRemoveRepository.ButtonClick += (o, e) => OnEvent(() => editRemoveRepositoryButtonClick(o, e, _gridViewBinder.FocusedElement));

            _screenBinder.Bind(x => x.ShowOnlyQualifiedTemplate)
            .To(chkShowQualifiedTemplate)
            .WithCaption(PKSimConstants.UI.OnlyShowQualifiedTemplates);
        }
示例#23
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            _gridViewBinder.Bind(x => x.ItemType)
            .WithCaption(Captions.Journal.RelatedItemType)
            .WithRepository(configureItemTypeRepository)
            .AsReadOnly();

            _gridViewBinder.Bind(x => x.Name)
            .WithCaption(Captions.Journal.Name)
            .AsReadOnly();

            _gridViewBinder.Bind(x => x.Origin)
            .WithCaption(Captions.Journal.Origin)
            .AsReadOnly();

            _gridViewBinder.Bind(x => x.Version)
            .WithCaption(Captions.Journal.Version)
            .AsReadOnly();

            _compareColumn = _gridViewBinder.AddUnboundColumn()
                             .WithCaption(UIConstants.EMPTY_COLUMN)
                             .WithShowButton(ShowButtonModeEnum.ShowAlways)
                             .WithRepository(getCompareRelatedItemRepository)
                             .WithEditorConfiguration(updateRelatedItemsForComparison)
                             .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH);

            _reloadColumn = _gridViewBinder.AddUnboundColumn()
                            .WithCaption(UIConstants.EMPTY_COLUMN)
                            .WithShowButton(ShowButtonModeEnum.ShowAlways)
                            .WithRepository(getReloadRelatedItemRepository)
                            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH);

            _deleteColumn = _gridViewBinder.AddUnboundColumn()
                            .WithCaption(UIConstants.EMPTY_COLUMN)
                            .WithShowButton(ShowButtonModeEnum.ShowAlways)
                            .WithRepository(x => _removeRelatedItemRepository)
                            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH);

            _removeRelatedItemRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.DeleteRelatedItem(_gridViewBinder.FocusedElement));
            _reloadRelatedItemRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.ReloadRelatedItem(_gridViewBinder.FocusedElement));

            buttonAddRelatedItemFromFile.Click += (o, e) => OnEvent(() => _presenter.AddRelatedItemFromFile());
            buttonReloadAllRelatedItems.Click  += (o, e) => OnEvent(() => _presenter.ReloadAllRelatedItems());
        }
示例#24
0
        protected void InitializeValueBinding()
        {
            //Use Autobind to enable error notification
            _columnValue = _gridViewBinder.AutoBind(param => param.Value)
                           .WithFormat(p => p.ParameterFormatter())
                           .WithCaption(PKSimConstants.UI.Value)
                           .WithRepository(repoForParameter)
                           .WithEditorConfiguration(configureRepository)
                           .WithShowButton(ShowButtonModeEnum.ShowAlways)
                           .WithOnValueUpdating((o, e) => OnEvent(() => _presenter.SetParameterValue(o, e.NewValue)));

            _comboBoxUnit.ParameterUnitSet += setParameterUnit;

            _editTableParameterRepository.ButtonClick   += (o, e) => OnEvent(editTable);
            _showTableParameterRepository.ButtonClick   += (o, e) => OnEvent(editTable);
            _isFixedParameterEditRepository.ButtonClick += (o, e) => OnEvent(resetParameter);
        }
        public override void InitializeBinding()
        {
            _colGrouping = _gridViewBinder.AutoBind(item => item.GroupingPathDTO)
                           .WithRepository(dto => configureContainerRepository(dto.GroupingPathDTO))
                           .WithCaption(PKSimConstants.UI.EmptyColumn)
                           .AsReadOnly();
            _colGrouping.XtraColumn.GroupIndex = 0;
            _colGrouping.XtraColumn.SortMode   = ColumnSortMode.Custom;

            _gridViewBinder.AutoBind(item => item.ContainerPathDTO)
            .WithRepository(dto => configureContainerRepository(dto.ContainerPathDTO))
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .AsReadOnly();

            _colRelativeExpression = _gridViewBinder.Bind(item => item.RelativeExpression)
                                     .WithCaption(PKSimConstants.UI.RelativeExpression)
                                     .WithOnValueSet((protein, args) => _presenter.SetRelativeExpression(protein, args.NewValue));

            var col = _gridViewBinder.Bind(item => item.RelativeExpressionNorm)
                      .WithCaption(PKSimConstants.UI.RelativeExpressionNorm)
                      .WithRepository(x => _progressBarRepository)
                      .AsReadOnly();

            //necessary to align center since double value are aligned right by default
            col.XtraColumn.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            col.XtraColumn.DisplayFormat.FormatType = FormatType.None;

            _screenBinder.Bind(x => x.TissueLocation)
            .To(cbLocalizationInTissue)
            .WithImages(x => _imageListRetriever.ImageIndex(_presenter.IconFor(x)))
            .WithValues(x => _presenter.AllTissueLocations())
            .AndDisplays(x => _presenter.DisplayFor(x))
            .OnValueSet += (o, e) => OnEvent(() => _presenter.TissueLocationChanged(e.NewValue));

            _screenBinder.Bind(x => x.IntracellularVascularEndoLocation)
            .To(chkIntracellularVascularEndoLocation)
            .WithValues(x => _presenter.AllIntracellularVascularEndoLocations())
            .OnValueSet += (o, e) => OnEvent(() => _presenter.IntracellularLocationVascularEndoChanged(e.NewValue));

            _screenBinder.Bind(x => x.MembraneLocation)
            .To(cbLocationOnVascularEndo)
            .WithValues(x => _presenter.AllMembraneLocation())
            .OnValueSet += (o, e) => OnEvent(() => _presenter.MembraneLocationChanged(e.NewValue));

            RegisterValidationFor(_screenBinder, NotifyViewChanged);
        }
示例#26
0
        public override void InitializeBinding()
        {
            _screenBinder.Bind(x => x.ImportFolder)
            .To(btnBrowseForFolder);

            _screenBinder.Bind(x => x.Messages)
            .To(tbLog);

            _colImage = _gridViewBinder.Bind(x => x.Image)
                        .WithCaption(PKSimConstants.UI.EmptyColumn)
                        .WithRepository(dto => _statusIconRepository)
                        .WithFixedWidth(EMBEDDED_BUTTON_WIDTH);

            _gridViewBinder.Bind(x => x.FilePath)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(x => _filePathRepository)
            .WithCaption(PKSimConstants.UI.FilePath);

            _gridViewBinder.Bind(x => x.NumberOfIndividuals)
            .WithCaption(PKSimConstants.UI.NumberOfIndividuals)
            .WithFixedWidth(PARAMETER_WIDTH)
            .WithFormat(new NullIntParameterFormatter())
            .AsReadOnly();

            _gridViewBinder.Bind(x => x.NumberOfQuantities)
            .WithCaption(PKSimConstants.UI.NumberOfOutputs)
            .WithFixedWidth(PARAMETER_WIDTH)
            .WithFormat(new NullIntParameterFormatter())
            .AsReadOnly();

            _gridViewBinder.AddUnboundColumn()
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(x => _removeButtonRepository)
            .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2);

            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.RemoveFile(_gridViewBinder.FocusedElement));
            _filePathRepository.ButtonClick     += (o, e) => OnEvent(() => _presenter.ChangePath(_gridViewBinder.FocusedElement));

            btnAddFile.Click += (o, e) => OnEvent(_presenter.AddFile);
            btnBrowseForFolder.ButtonClick += (o, e) => OnEvent(_presenter.BrowseForFolder);
            btnImport.Click += (o, e) => OnEvent(() => _presenter.StartImportProcess());

            _gridViewBinder.Changed += NotifyViewChanged;
            RegisterValidationFor(_screenBinder, NotifyViewChanged);
        }
示例#27
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            bind(x => x.UniqueIndex)
            .WithCaption(UIConstants.EMPTY_COLUMN)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH);

            bind(x => x.Title)
            .WithRepository(configureTitleRepository)
            .WithCaption(Captions.Journal.Title);

            var colCreatedAt = bind(x => x.CreatedAt)
                               .WithFormat(_dateTimeFormatter)
                               .WithCaption(Captions.Journal.CreatedAt);

            _columnTags = bind(x => x.TagsDisplay)
                          .WithCaption(Captions.Journal.Tags);

            //since we are overriding the default behavior of tag filtering, we need to use list instead of the default
            _columnTags.XtraColumn.OptionsFilter.FilterPopupMode = FilterPopupMode.List;

            var colUpdatedAt = bind(x => x.UpdatedAt)
                               .WithFormat(_dateTimeFormatter)
                               .WithCaption(Captions.Journal.UpdatedAt);

            var colUpdatedBy = bind(x => x.UpdatedBy)
                               .WithCaption(Captions.Journal.UpdatedBy);

            var colCreatedBy = bind(x => x.CreatedBy)
                               .WithCaption(Captions.Journal.CreatedBy);

            var colDescription = bind(x => x.Description)
                                 .WithRepository(x => _descriptionRepository)
                                 .WithCaption(Captions.Journal.Description);

            colDescription.Visible = false;
            colDescription.XtraColumn.OptionsColumn.ShowInCustomizationForm = false;
            colUpdatedBy.Visible = false;
            colCreatedBy.Visible = false;
            colUpdatedAt.Visible = false;

            colCreatedAt.XtraColumn.SortOrder = ColumnSortOrder.Descending;
            gridView.PreviewFieldName         = colDescription.XtraColumn.FieldName;
        }
示例#28
0
        public override void InitializeBinding()
        {
            _colGrouping = _gridViewBinder.AutoBind(item => item.GroupingPathDTO)
                           .WithRepository(dto => configureContainerRepository(dto.GroupingPathDTO))
                           .WithCaption(PKSimConstants.UI.EmptyColumn)
                           .AsReadOnly();
            _colGrouping.XtraColumn.GroupIndex = 0;
            _colGrouping.XtraColumn.SortMode   = ColumnSortMode.Custom;

            _gridViewBinder.AutoBind(item => item.ContainerPathDTO)
            .WithRepository(dto => configureContainerRepository(dto.ContainerPathDTO))
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .AsReadOnly();

            _columnValue = _gridViewBinder.Bind(item => item.RelativeExpression)
                           .WithCaption(PKSimConstants.UI.RelativeExpression)
                           .WithOnValueSet((protein, args) => _presenter.SetRelativeExpression(protein, args.NewValue));

            var col = _gridViewBinder.Bind(item => item.RelativeExpressionNorm)
                      .WithCaption(PKSimConstants.UI.RelativeExpressionNorm)
                      .WithRepository(x => _progressBarRepository)
                      .AsReadOnly();

            //necessary to align center since double value are aligned right by default
            col.XtraColumn.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            col.XtraColumn.DisplayFormat.FormatType = FormatType.None;


            _gridViewBinder.Bind(x => x.IsFavorite)
            .WithCaption(PKSimConstants.UI.Favorites)
            .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_CHECK_BOX_WIDTH)
            .WithRepository(x => _favoriteRepository)
            .WithToolTip(PKSimConstants.UI.FavoritesToolTip)
            .WithOnValueSet((o, e) => OnEvent(() => _presenter.SetFavorite(o, e.NewValue)));


            _screenBinder.Bind(x => x.ReferenceConcentration).To(_uxReferenceConcentration);
            _uxReferenceConcentration.RegisterEditParameterEvents(_presenter);

            _screenBinder.Bind(x => x.HalfLifeLiver).To(_uxHalfLifeLiver);
            _uxHalfLifeLiver.RegisterEditParameterEvents(_presenter);

            _screenBinder.Bind(x => x.HalfLifeIntestine).To(_uxHalfLifeIntestine);
            _uxHalfLifeIntestine.RegisterEditParameterEvents(_presenter);
        }
示例#29
0
        public override void InitializeBinding()
        {
            _colValue = _gridViewBinder.AutoBind(x => x.FractionUnbound)
                        .WithCaption(PKSimConstants.UI.FractionUnbound)
                        .WithFormat(dto => dto.FractionUnboundParameter.ParameterFormatter())
                        .WithEditorConfiguration((editor, sol) => _comboBoxUnit.UpdateUnitsFor(editor, sol.FractionUnboundParameter))
                        .WithOnValueUpdating((dto, e) => OnEvent(() => fractionUnboundGroupPresenter.SetFractionUnboundValue(dto, e.NewValue)));

            _comboBoxUnit.ParameterUnitSet += (dto, unit) => OnEvent(() => fractionUnboundGroupPresenter.SetFractionUnboundUnit(dto, unit));

            _gridViewBinder.Bind(x => x.Species)
            .WithRepository(dto => configureSpeciesRepository())
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithOnValueUpdating((dto, e) => OnEvent(() => fractionUnboundGroupPresenter.SetSpeciesValue(dto, e.NewValue)));

            //to do at the end to respect order
            base.InitializeBinding();
        }
示例#30
0
        public override void InitializeBinding()
        {
            _gridViewBinder.Bind(dto => dto.CompoundType)
            .WithRepository(dto => compoundTypeRepository())
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .OnValueUpdating += (dto, e) => compoundTypeGroupPresenter.SetCompoundType(dto, e.NewValue);

            _colPKa = _gridViewBinder.Bind(x => x.PKa)
                      .WithEditRepository(x => _parameterEditRepository)
                      .WithFormat(dto => new PKaFormatter(dto))
                      .WithOnValueUpdating((dto, e) => compoundTypeGroupPresenter.SetPKa(dto, e.NewValue));

            _colFavorites = _gridViewBinder.Bind(x => x.IsFavorite)
                            .WithCaption(PKSimConstants.UI.Favorites)
                            .WithFixedWidth(EMBEDDED_CHECK_BOX_WIDTH)
                            .WithRepository(x => _favoriteRepository)
                            .WithToolTip(PKSimConstants.UI.FavoritesToolTip)
                            .WithOnValueUpdating((o, e) => OnEvent(() => compoundTypeGroupPresenter.SetFavorite(o, e.NewValue)));
        }