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));
        }
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            _pathElementsBinder.InitializeBinding(_gridViewBinder);

            _gridViewBinder.Bind(x => x.InitialValue)
            .WithCaption(Captions.ParameterIdentification.InitialValue)
            .WithFormat(dto => new UnitFormatter(dto.DisplayUnit))
            .AsReadOnly();

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

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

            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.RemoveParameter(_gridViewBinder.FocusedElement));
            _unlinkButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.UnlinkParameter(_gridViewBinder.FocusedElement));
            _gridViewBinder.Changed             += NotifyViewChanged;
        }
Exemplo n.º 3
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            _gridViewBinder.AutoBind(x => x.ObserverSet)
            .WithRepository(initObserverSetRepository)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithCaption(PKSimConstants.ObjectTypes.ObserverSet);

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

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

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

            btnAddObserverSet.Click += (o, e) => OnEvent(_presenter.AddObserverSet);

            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.RemoveObserverSetMapping(_gridViewBinder.FocusedElement));
            _loadButtonRepository.ButtonClick   += (o, e) => OnEvent(() => _presenter.LoadObserverSetFor(_gridViewBinder.FocusedElement));
            _createButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.CreateObserverFor(_gridViewBinder.FocusedElement));

            _gridViewBinder.Changed += NotifyViewChanged;
        }
        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);
        }
        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(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(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;
        }
Exemplo n.º 6
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(UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2);

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

            _gridViewBinder.Changed += NotifyViewChanged;
        }
Exemplo n.º 7
0
        public override void InitializeBinding()
        {
            _gridViewBinder = new GridViewBinder <DefaultUnitMapDTO>(gridView);
            _gridViewBinder.AutoBind(x => x.Dimension)
            .WithRepository(dto => _allDimensionsRepository)
            .WithEditorConfiguration(editDimensionForCurrentMap)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);

            _gridViewBinder.AutoBind(x => x.DisplayUnit)
            .WithCaption(Captions.DisplayUnit)
            .WithRepository(dto => _allUnitsRepository)
            .WithEditorConfiguration(editUnitForCurrentMap)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);

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

            _gridViewBinder.Changed       += NotifyViewChanged;
            _deleteRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.RemoveDefaultUnit(_gridViewBinder.FocusedElement));
            btnAddUnitMap.Click           += (o, e) => OnEvent(_presenter.AddDefaultUnit);
            btnSaveUnits.Click            += (o, e) => OnEvent(_presenter.SaveUnitsToFile);
            btnLoadUnits.Click            += (o, e) => OnEvent(_presenter.LoadUnitsFromFile);
        }
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            _colName = _gridViewBinder.AutoBind(x => x.Name)
                       .WithCaption(Captions.Name)
                       .WithRepository(nameRepository)
                       .WithOnValueUpdating(onNameChanged);

            _colValue = _gridViewBinder.AutoBind(x => x.Value)
                        .WithCaption(Captions.Value)
                        .WithRepository(valueRepository)
                        .WithShowButton(ShowButtonModeEnum.ShowAlways)
                        .WithEditorConfiguration(configureValueRepository)
                        .WithOnValueUpdating(onValueChanged);

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

            _molWeightBinder.Bind(x => x.ValueInDisplayUnit)
            .To(tbMolWeight)
            .WithFormat(dto => new UnitFormatter(dto.DisplayUnit))
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetMolWeight(e.OldValue, e.NewValue));

            _lowerLimitOfQuantificationBinder.Bind(x => x.ValueInDisplayUnit)
            .To(tbLowerLimitOfQuantification)
            .WithFormat(dto => new UnitFormatter(dto.DisplayUnit));

            btnAddRow.Click += (o, e) => OnEvent(_presenter.NewMetaDataAdded);
            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(_presenter.RemoveMetaData, _gridViewBinder.FocusedElement);
        }
Exemplo n.º 9
0
        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; };
        }
Exemplo n.º 10
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            buttonSelectFolder.Properties.Buttons[0].Kind    = ButtonPredefines.Glyph;
            buttonSelectFolder.Properties.Buttons[0].Caption = Captions.Browse;
            buttonSelectFolder.ButtonClick += (o, e) => OnEvent(_presenter.SelectFolder);

            buttonAdd.Click        += (o, e) => OnEvent(() => _presenter.AddFolder(buttonSelectFolder.Text));
            buttonClearList.Click  += (o, e) => OnEvent(_presenter.ClearFolderList);
            buttonImportList.Click += (o, e) => OnEvent(_presenter.ImportFolderList);
            buttonExportList.Click += (o, e) => OnEvent(_presenter.ExportFolderList);

            _screenBinder.Bind(x => x.CurrentFolder)
            .To(buttonSelectFolder);

            _gridViewBinder.Bind(x => x.Folder);
            _gridViewBinder.AddUnboundColumn()
            .WithCaption(UIConstants.EMPTY_COLUMN)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(x => _deleteRepository)
            .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH);

            _gridViewBinder.Changed += NotifyViewChanged;

            radioGroupExportMode.SelectedIndexChanged += (o, e) => OnEvent(exportModeChanged);
            _deleteRepository.ButtonClick             += (o, e) => OnEvent(() => _presenter.RemoveFolder(_gridViewBinder.FocusedElement));
        }
Exemplo n.º 11
0
        private void InitBinding()
        {
            _screenBinder.Bind(item => item.FirstName).To(textEdit);

            _screenBinder.Bind(item => item.LastName).To(textEditLastName);

            _screenBinder.Bind(item => item.Value).To(textEditDouble);
            _screenBinder.Bind(item => item.Log).To(memoEdit);

            _screenBinder.Bind(item => item.NullableValue).To(textNullableEdit);
            _screenBinder.Bind(item => item.IntValue).To(textEditForInt);
            _screenBinder.Bind(item => item.MyColor).To(colorEdit);
            _screenBinder.Bind(item => item.MyNullableColor).To(nullableColorEdit);
            _screenBinder.Bind(item => item.FirstName).To(mruEdit1);
            _screenBinder.Bind(item => item.ValueFromList).To(comboBoxEdit1).WithValues(item => item.ListOfValues).AndDisplays(item => item.ListOfDisplayValues);
            _screenBinder.Bind(item => item.ValueFromList).To(listBoxControl).WithValues(item => item.ListOfValues).AndDisplays(item => item.ListOfDisplayValues);

            _screenBinder.Bind(iten => iten.BoolValue).To(chkEdit).WithCaption("one caption").OnValueUpdating += OnBoolValueSet;

            _screenBinder.Bind(item => item.ValueFromList).To(imageComboBoxEdit1)
            .WithImages(ImagesFor)
            .WithValues(item => item.ListOfValues)
            .AndDisplays(item => item.ListOfDisplayValues);

            _screenBinder.OnValidationError += OnValidationError;
            _screenBinder.OnValidated       += OnValidated;

            _screenBinder2.Bind(item => item.LastName).To(anotherTextBox);

            _gridBinder.Bind(item => item.FirstName).AsReadOnly();
            _gridBinder.Bind(item => item.LastName).OnValueUpdating += OnLastNameSet;
            _gridBinder.Bind(item => item.NullableValue).WithCaption("My Nullable Set");
            _gridBinder.Bind(item => item.Value)
            .WithCaption("My Value Set");

            _gridBinder.Bind(item => item.Value)
            .WithRepository(MyBarRepository)
            .WithEditRepository(MyRepoForDouble)
            .WithCaption("My Value Bar").OnValueUpdating += OnValueSet;

            _gridBinder.AutoBind(item => item.Value)
            .WithRepository(MyRepoForDouble)
            .WithCaption("My Value Bar");

            _gridBinder.AutoBind(item => item.IntValue)
            .WithCaption("Int Value")
            .WithFilterPopupMode(FilterPopupMode.Default)
            .WithOnValueUpdating(AutoBindOnValueSet);

            _gridBinder.AddUnboundColumn()
            .WithCaption("A great button")
            .WithRepository(RepositoryItemButton)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);

            _gridBinder.Changed    += GridBinderChanged;
            _screenBinder.Changed  += GridBinderChanged;
            _screenBinder.Changing += () => AddLine("Screen Binder Changing");
            btnReset.Click         += (o, e) => _gridBinder.Reset();
            btnApply.Click         += (o, e) => _gridBinder.Update();
        }
Exemplo n.º 12
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());
        }
Exemplo n.º 13
0
        public override void InitializeBinding()
        {
            _gridViewBinder = new GridViewBinder <OutputIntervalDTO>(gridViewIntervals)
            {
                BindingMode = BindingMode.OneWay, ValidationMode = ValidationMode.LeavingRow
            };

            _gridViewBinder.Bind(dto => dto.StartTime)
            .WithFormat(x => x.StartTimeParameter.ParameterFormatter())
            .WithCaption(AppConstants.Captions.StartTime)
            .WithEditorConfiguration((activeEditor, intervalDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, intervalDTO.StartTimeParameter as ParameterDTO))
            .OnValueUpdating += (o, e) => setParameterValue(o.StartTimeParameter, e.NewValue);

            _gridViewBinder.Bind(dto => dto.EndTime)
            .WithFormat(x => x.EndTimeParameter.ParameterFormatter())
            .WithCaption(AppConstants.Captions.EndTime)
            .WithEditorConfiguration((activeEditor, intervalDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, intervalDTO.EndTimeParameter as ParameterDTO))
            .OnValueUpdating += (o, e) => setParameterValue(o.EndTimeParameter, e.NewValue);

            _gridViewBinder.Bind(dto => dto.Resolution)
            .WithFormat(x => x.ResolutionParameter.ParameterFormatter())
            .WithEditorConfiguration((activeEditor, intervalDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, intervalDTO.ResolutionParameter as ParameterDTO))
            .OnValueUpdating += (o, e) => setParameterValue(o.ResolutionParameter, e.NewValue);

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

            _comboBoxUnit.ParameterUnitSet += setParameterUnit;
            gridViewIntervals.HiddenEditor += (o, e) => { _comboBoxUnit.Visible = false; };
        }
 protected IGridViewColumn BindToDeleteInteraction()
 {
     return(_gridViewBinder.AddUnboundColumn()
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(x => _removeField)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH));
 }
Exemplo n.º 15
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());
        }
        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");
        }
Exemplo n.º 17
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            _screenBinder.Bind(item => item.FormulaString)
            .To(txtFormulaString)
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetFormulaString(e.NewValue, e.OldValue));

            _colAlias = _gridBinder.Bind(x => x.Alias)
                        .WithOnValueUpdating((formulaUsablePathDTO, e) => OnEvent(() => _presenter.SetAlias(e.NewValue, e.OldValue, formulaUsablePathDTO.FormulaUsablePath)))
                        .WithToolTip(ToolTips.Formula.ReferenceAlias);

            _colPath = _gridBinder.Bind(x => x.Path)
                       .WithOnValueUpdating((dto, e) => OnEvent(() => _presenter.SetFormulaUsablePath(e.NewValue, dto)))
                       .WithToolTip(ToolTips.Formula.ReferencePath);

            _colDimension = _gridBinder.Bind(x => x.Dimension)
                            .WithRepository(dto => createDimensionRepository())
                            .WithOnValueUpdating((formulaUsablePathDTO, e) => OnEvent(() => _presenter.SetFormulaPathDimension(e.NewValue, e.OldValue, formulaUsablePathDTO)))
                            .WithToolTip(ToolTips.Formula.ReferenceDimension);

            _colRemoveButton = _gridBinder.AddUnboundColumn()
                               .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN)
                               .WithShowButton(ShowButtonModeEnum.ShowAlways)
                               .WithRepository(dto => _removeButtonRepository)
                               .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH);

            _colAddButton = _gridBinder.AddUnboundColumn()
                            .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN)
                            .WithShowButton(ShowButtonModeEnum.ShowAlways)
                            .WithRepository(dto => _addButtonRepository)
                            .WithFixedWidth((OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH));

            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(removeFormulaUsablePath, _gridBinder.FocusedElement);
            _addButtonRepository.ButtonClick    += (o, e) => OnEvent(cloneFormulaUsablePath, _gridBinder.FocusedElement);

            RegisterValidationFor(_screenBinder, NotifyViewChanged);
            ReadOnly = false;
            gridViewReferencePaths.MouseDown += (o, e) => OnEvent(() => onGridViewMouseDown(e));
            grdObjectPaths.DragDrop          += (o, e) => OnEvent(onDragDrop, e);
            grdObjectPaths.DragOver          += (o, e) => OnEvent(onDragOver, e);
            DragDrop += (o, e) => OnEvent(onDragDrop, e);
            DragOver += (o, e) => OnEvent(onDragOver, e);
        }
Exemplo n.º 18
0
        public override void InitializeBinding()
        {
            var createButtonRepository = createEventButtonRepository();
            var loadButtonRepository   = loadEventButtonRepository();

            _columnValue = _gridViewBinder.Bind(param => param.StartTime);
            _columnValue.WithFormat(eventMappingDTO => eventMappingDTO.StartTimeParameter.ParameterFormatter())
            .WithCaption(PKSimConstants.UI.StartTime)
            .WithEditorConfiguration((activeEditor, eventMappingDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, eventMappingDTO.StartTimeParameter))
            .OnValueUpdating += (dto, valueInGuiUnit) => setParameterValue(dto.StartTimeParameter, valueInGuiUnit.NewValue);

            _gridViewBinder.AutoBind(x => x.Event)
            .WithRepository(x => _eventRepository)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithEditorConfiguration(configureEventRepository);

            _colCreateEvent = _gridViewBinder.AddUnboundColumn()
                              .WithCaption(PKSimConstants.UI.EmptyColumn)
                              .WithShowButton(ShowButtonModeEnum.ShowAlways)
                              .WithFixedWidth(EMBEDDED_BUTTON_WIDTH)
                              .WithRepository(dto => createButtonRepository);

            _colLoadEvent = _gridViewBinder.AddUnboundColumn()
                            .WithCaption(PKSimConstants.UI.EmptyColumn)
                            .WithShowButton(ShowButtonModeEnum.ShowAlways)
                            .WithFixedWidth(EMBEDDED_BUTTON_WIDTH)
                            .WithRepository(dto => loadButtonRepository);

            _colRemoveEvent = _gridViewBinder.AddUnboundColumn()
                              .WithCaption(PKSimConstants.UI.EmptyColumn)
                              .WithFixedWidth(EMBEDDED_BUTTON_WIDTH)
                              .WithShowButton(ShowButtonModeEnum.ShowAlways)
                              .WithRepository(dto => _removeButtonRepository);

            btnAddEvent.Click += (o, e) => OnEvent(_presenter.AddEventMapping);
            _comboBoxUnit.ParameterUnitSet      += setParameterUnit;
            gridView.HiddenEditor               += (o, e) => { _comboBoxUnit.Visible = false; };
            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.RemoveEventMapping(_gridViewBinder.FocusedElement));

            loadButtonRepository.ButtonClick   += (o, e) => OnEvent(() => _presenter.LoadEventAsync(_gridViewBinder.FocusedElement));
            createButtonRepository.ButtonClick += (o, e) => OnEvent(() => _presenter.CreateEventFor(_gridViewBinder.FocusedElement));
        }
Exemplo n.º 19
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            gridControl.MouseClick += (o, e) => OnEvent(() => GridPartnerMouseClick(_gridBinder, e));

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

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

            _removeButtonRepository.ButtonClick += (o, e) => OnEvent(removeReactionPartner, _gridBinder.FocusedElement);
            _addButtonRepository.ButtonClick    += (o, e) => OnEvent(addReactionPartner, _gridBinder.FocusedElement);
        }
        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);
        }
Exemplo n.º 21
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);
        }
Exemplo n.º 22
0
        private void initializeBinder(GridViewBinder <StringDTO> gridViewBinder, Action <string> deleteAction)
        {
            gridViewBinder.Bind(name => name.Print)
            .WithCaption(AppConstants.Captions.Molecule)
            .AsReadOnly();

            var buttonRepository = createAddRemoveButtonRepository();

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

            buttonRepository.ButtonClick += (o, e) => OnEvent(() => onButtonClicked(e, gridViewBinder.FocusedElement, deleteAction));
        }
Exemplo n.º 23
0
        public override void InitializeBinding()
        {
            // initialize RepositoryItems
            _numberModeRepository.Items.AddRange(Enum.GetValues(typeof(NumberModes)));
            _lineStyleRepository.Items.AddRange(Enum.GetValues(typeof(LineStyles)));

            _gridBinderAxes = new GridViewBinder <Axis>(gridView)
            {
                BindingMode = BindingMode.TwoWay
            };

            createColumn(x => x.AxisType, AxisOptionsColumns.AxisType)
            .AsReadOnly();

            createColumn(x => x.Caption, AxisOptionsColumns.Caption);

            createColumn(x => x.Dimension, AxisOptionsColumns.Dimension, _dimensionRepository)
            .WithEditorConfiguration(configureDimensionRepository);

            createColumn(x => x.UnitName, AxisOptionsColumns.UnitName, _unitRepository, beforeNotificationAction: x => _presenter.UnitChanged(x))
            .WithEditorConfiguration(configureUnitEditor);

            createColumn(x => x.Scaling, AxisOptionsColumns.Scaling, _scalingRepository);

            createColumn(x => x.NumberMode, AxisOptionsColumns.NumberMode, _numberModeRepository);

            createColumn(x => x.Min, AxisOptionsColumns.Min);

            createColumn(x => x.Max, AxisOptionsColumns.Max);

            createColumn(x => x.GridLines, AxisOptionsColumns.GridLines, _gridLinesRepository);

            createColumn(x => x.DefaultColor, AxisOptionsColumns.DefaultColor, _colorRepository, toolTip: ToolTips.DefaultCurveColor)
            .WithRepository(defaultColorRepository);

            createColumn(x => x.DefaultLineStyle, AxisOptionsColumns.DefaultLineStyle, _lineStyleRepository, toolTip: ToolTips.DefaultLineStyle)
            .WithRepository(defaultLineStyleRepository);

            //Add/Delete-column
            _gridBinderAxes.AddUnboundColumn()
            .WithCaption(UIConstants.EMPTY_COLUMN)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH)
            .WithRepository(getButton);

            _gridBinderAxes.Changed += NotifyViewChanged;
        }
Exemplo n.º 24
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);
        }
Exemplo n.º 25
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            _gridBinder.Bind(tag => tag.Value)
            .WithCaption(AppConstants.Captions.Tag)
            .AsReadOnly();

            _addRemoveButtonRepository.ButtonClick += (o, e) => OnEvent(() => onButtonClicked(e, _gridBinder.FocusedElement));

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

            btnAddTag.Click += (o, e) => OnEvent(_presenter.AddNewTag);
        }
        public override void InitializeBinding()
        {
            _gridViewBinder.Bind(x => x.Selected)
            .WithRepository(x => _selectionRepository);

            _gridViewBinder.AddUnboundColumn()
            .WithCaption(PKSimConstants.UI.Name)
            .WithRepository(editRepository)
            .AsReadOnly();

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

            _gridViewBinder.Changed += NotifyViewChanged;
        }
Exemplo n.º 27
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);
        }
Exemplo n.º 28
0
        private void intializeSchemaItemBinding(GridViewBinder <SchemaItemDTO> schemaItemBinder)
        {
            var applicationRepository      = new UxRepositoryItemImageComboBox(schemaItemBinder.GridView, _imageListRetriever);
            var schemaItemButtonRepository = createAddRemoveButtonRepository();

            var colStartTime = schemaItemBinder.AutoBind(x => x.StartTime)
                               .WithCaption(PKSimConstants.UI.StartTime)
                               .WithFormat(dto => dto.StartTimeParameter.ParameterFormatter())
                               .WithEditorConfiguration((activeEditor, schemaItemDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, schemaItemDTO.StartTimeParameter));

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

            schemaItemBinder.AutoBind(x => x.Dose)
            .WithCaption(PKSimConstants.UI.Dose)
            .WithFormat(dto => dto.DoseParameter.ParameterFormatter())
            .WithEditorConfiguration((activeEditor, schemaItemDTO) => _comboBoxUnit.UpdateUnitsFor(activeEditor, schemaItemDTO.DoseParameter))
            .OnValueUpdating += (dto, valueInGuiUnit) => setParameterValue(dto.DoseParameter, valueInGuiUnit.NewValue);

            var appTypeColumn = schemaItemBinder.AutoBind(x => x.ApplicationType)
                                .WithRepository(x => configureApplicationRepository(applicationRepository))
                                .WithCaption(PKSimConstants.UI.ApplicationType)
                                .WithShowButton(ShowButtonModeEnum.ShowAlways);

            appTypeColumn.OnChanged       += dto => updateApplicationParameter(schemaItemBinder, dto);
            appTypeColumn.OnValueUpdating += (dto, applicationType) => setApplicationType(dto, applicationType.NewValue);

            var formulationColumn = schemaItemBinder.AutoBind(x => x.FormulationKey);

            formulationColumn.WithRepository(formulationRepository)
            .WithCaption(PKSimConstants.UI.PlaceholderFormulation)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);

            formulationColumn.OnValueUpdating += (dto, formulationType) => OnEvent(() => _presenter.SetFormulationType(dto, formulationType.NewValue));

            schemaItemBinder.AddUnboundColumn()
            .WithCaption(PKSimConstants.UI.EmptyColumn)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(dto => schemaItemButtonRepository)
            .WithFixedWidth(UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2);

            schemaItemBinder.Changed += NotifyViewChanged;

            schemaItemButtonRepository.ButtonClick += (o, e) => OnEvent(() => schemaItemButtonRepositoryButtonClick(o, e, schemaItemBinder.FocusedElement));
        }
Exemplo n.º 29
0
        public override void InitializeBinding()
        {
            _gridViewBinder.AutoBind(x => x.Name)
            .AsReadOnly();

            _gridViewBinder.AutoBind(x => x.IsDefault)
            .WithCaption(Captions.Default).WithRepository(template => _checkEditRepository)
            .WithOnValueUpdating((template, propertyValueSetEventArgs) => OnEvent(() => setDefaultForTemplate(template, propertyValueSetEventArgs.NewValue)));

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

            _buttonRepository.ButtonClick += (o, e) => OnEvent(buttonClicked, e);

            loadTemplateButton.Click += (o, e) => OnEvent(loadTemplates);
        }
Exemplo n.º 30
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            _screenBinder = new ScreenBinder <EventBuilderDTO>();
            _screenBinder.Bind(dto => dto.Name).To(btName).OnValueUpdating            += onPropertyValueSet;
            _screenBinder.Bind(dto => dto.Description).To(htmlEditor).OnValueUpdating += onPropertyValueSet;
            _screenBinder.Bind(dto => dto.OneTime).To(chkOneTime).OnValueUpdating     += onPropertyValueSet;
            _screenBinder.Bind(dto => dto.Condition).To(cmbCondition)
            .WithValues(dto => _presenter.AllFormulaNames())
            .OnValueUpdating += onConditionFormulaNameSet;

            _gridBinder = new GridViewBinder <EventAssignmentBuilderDTO>(gridViewAssignments);
            var selectButtonRepository = createSelectButtonRepository();

            selectButtonRepository.ButtonClick += (o, e) => onSelectButtonClick(_gridBinder.FocusedElement);

            _gridBinder.Bind(dto => dto.ChangedEntityPath)
            .WithCaption(AppConstants.Captions.ChangedEntityPath)
            .WithOnValueUpdating((dto, e) => OnEvent(() => _presenter.SetChangedEntityPath(e.NewValue, dto)))
            .WithRepository(d => selectButtonRepository)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);

            _gridBinder.Bind(dto => dto.NewFormula)
            .WithCaption(AppConstants.Captions.NewFormula)
            .WithRepository(d => getFormulaRepository(gridViewAssignments))
            .WithOnValueUpdating(onAssignmentFormulaSet);

            _gridBinder.Bind(dto => dto.UseAsValue)
            .WithCaption(AppConstants.Captions.UseAsValue)
            .OnValueUpdating += onAssignmentPropertySet;

            var buttonRepository = createAddRemoveButtonRepository();

            _gridBinder.AddUnboundColumn()
            .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN)
            .WithShowButton(ShowButtonModeEnum.ShowAlways)
            .WithRepository(dto => buttonRepository)
            .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2);
            buttonRepository.ButtonClick += (o, e) => onButtonClicked(e, _gridBinder.FocusedElement);

            RegisterValidationFor(_screenBinder, NotifyViewChanged);
        }