コード例 #1
0
        private void chartObjectHotTracked(object sender, HotTrackEventArgs e)
        {
            var point = e.AdditionalObject as SeriesPoint;

            if (point == null)
            {
                hideToolTip(e);
                return;
            }

            var schemaItemDTO = _presenter.SchemaItemDTOFrom(point.Tag);
            var message       = _presenter.DescriptionFor(schemaItemDTO);

            if (string.IsNullOrEmpty(message) || schemaItemDTO == null)
            {
                hideToolTip(e);
                return;
            }

            var imageIndex = _imageListRetriever.ImageIndex(schemaItemDTO.IconName);

            if (imageIndex != _toolTipController.ImageIndex)
            {
                hideToolTip(e);
            }

            _toolTipController.ImageIndex = _imageListRetriever.ImageIndex(schemaItemDTO.IconName);
            _toolTipController.ShowHint(message);
        }
コード例 #2
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            uxRichEditControl.ReplaceService <IRichEditCommandFactoryService>(createCustomCommandFactoryService());
            uxRichEditControl.SearchFormShowing += (o, e) => OnEvent(onSearchFormShowing, e);

            _screenBinder.Bind(x => x.Title)
            .To(tbTitle)
            .Changing += () => OnEvent(changeTitle);

            _tokenBinder = _screenBinder
                           .Bind(item => item.Tags)
                           .To(tagEdit)
                           .OnSelectedItemsChanged(tags => _presenter.TagsChanged(tags))
                           .WithKnownTokens(workingJournalItem => _presenter.AllKnownTags);

            _screenBinder.Bind(x => x.Origin)
            .To(cbOrigin)
            .WithImages(x => _imageListRetriever.ImageIndex(x.IconName))
            .WithValues(dto => _presenter.AllOrigins)
            .AndDisplays(x => x.DisplayName)
            .Changed += () => OnEvent(originChanged);

            buttonPreviousPage.Click += (o, e) => OnEvent(_presenter.NavigateToPreviousPage);
            buttonNextPage.Click     += (o, e) => OnEvent(_presenter.NavigateToNextPage);
        }
コード例 #3
0
        private RepositoryItem getTransporterMembraneRepository(TransporterExpressionContainerDTO containerDTO)
        {
            string displayName       = containerDTO.ContainerPathDTO.DisplayName;
            string fullDisplayName   = membraneContainerDisplayName(containerDTO.MembraneLocation, containerDTO);
            var    allMembranesTypes = _presenter.AllProteinMembraneLocationsFor(containerDTO).ToList();

            if (allMembranesTypes.Count > 1)
            {
                displayName = fullDisplayName;
            }

            var repositoryItemImageComboBox = new UxRepositoryItemImageComboBox(gridView, _imageListRetriever)
            {
                ReadOnly = (allMembranesTypes.Count == 1), AllowDropDownWhenReadOnly = DefaultBoolean.False
            };

            if (repositoryItemImageComboBox.ReadOnly)
            {
                repositoryItemImageComboBox.Buttons.Clear();
            }


            var comboBoxItem = new ImageComboBoxItem(displayName, containerDTO.MembraneLocation, _imageListRetriever.ImageIndex(containerDTO.ContainerPathDTO.IconName));

            repositoryItemImageComboBox.Items.Add(comboBoxItem);
            return(repositoryItemImageComboBox);
        }
コード例 #4
0
        public override void InitializeBinding()
        {
            _settingsBinder  = new ScreenBinder <IndividualSettingsDTO>();
            _parameterBinder = new ScreenBinder <IndividualSettingsDTO>();
            _gridParameterValueVersionsBinder = new GridViewBinder <CategoryParameterValueVersionDTO>(gridViewParameterValueVersions);
            _gridCalculationMethodsBinder     = new GridViewBinder <CategoryCalculationMethodDTO>(gridViewCalculationMethods);
            gridViewParameterValueVersions.CustomRowFilter += (o, e) => customizedParameterValueVersionRowVisibility(e);
            gridViewCalculationMethods.CustomRowFilter     += (o, e) => customizedCalculationMethodsRowVisibility(e);
            _toolTipController.GetActiveObjectInfo         += onToolTipControllerGetActiveObjectInfo;

            _settingsBinder.Bind(dto => dto.Species)
            .To(cbSpecies)
            .WithImages(species => _imageListRetriever.ImageIndex(species.Icon))
            .WithValues(dto => _presenter.AllSpecies())
            .AndDisplays(species => species.DisplayName)
            .Changed += () => _presenter.SpeciesChanged();

            _settingsBinder.Bind(dto => dto.SpeciesPopulation)
            .To(cbPopulation)
            .WithValues(dto => _presenter.PopulationsFor(dto.Species))
            .AndDisplays(pop => pop.DisplayName)
            .Changed += () => _presenter.PopulationChanged();

            _settingsBinder.Bind(dto => dto.Gender)
            .To(cbGender)
            .WithValues(dto => _presenter.GenderFor(dto.SpeciesPopulation))
            .AndDisplays(gender => gender.DisplayName)
            .Changed += () => _presenter.GenderChanged();

            _gridParameterValueVersionsBinder.Bind(pvv => pvv.DisplayName).AsReadOnly();
            _gridParameterValueVersionsBinder.Bind(pvv => pvv.ParameterValueVersion)
            .WithRepository(pvv => _repositoryForParameterValueVersions)
            .WithEditorConfiguration(updatePvvListForCategory)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);
            _gridParameterValueVersionsBinder.Changed += settingsChanged;

            _gridCalculationMethodsBinder.Bind(cm => cm.DisplayName).AsReadOnly();
            _gridCalculationMethodsBinder.Bind(cm => cm.CalculationMethod)
            .WithRepository(cm => _repositoryForCalculationMethods)
            .WithEditorConfiguration(updateCmListForCategory)
            .WithShowButton(ShowButtonModeEnum.ShowAlways);
            _gridCalculationMethodsBinder.Changed += settingsChanged;

            _parameterBinder.Bind(dto => dto.ParameterAge)
            .To(uxAge)
            .Changed += () => _presenter.AgeChanged();

            _parameterBinder.Bind(dto => dto.ParameterGestationalAge)
            .To(uxGestationalAge)
            .Changed += () => _presenter.GestationalAgeChanged();

            _parameterBinder.Bind(dto => dto.ParameterHeight).To(uxHeight);
            _parameterBinder.Bind(dto => dto.ParameterWeight).To(uxWeight);
            _parameterBinder.Bind(dto => dto.ParameterBMI).To(uxBMI);

            btnMeanValues.Click += (o, e) => this.DoWithinWaitCursor(() => OnEvent(_presenter.RetrieveMeanValues));

            RegisterValidationFor(_settingsBinder, settingsChanged, settingsChanged);
            RegisterValidationFor(_parameterBinder, settingsChanged, settingsChanged);
        }
コード例 #5
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            _screenBinder.Bind(x => x.Source)
            .To(imageComboBoxValueOriginSource)
            .WithImages(x => _imageListRetriever.ImageIndex(x.IconName))
            .WithValues(x => _presenter.AllValueOriginSources)
            .AndDisplays(x => x.Display);

            _screenBinder.Bind(x => x.Method)
            .To(imageComboBoxValueOriginDeterminationMethod)
            .WithImages(x => _imageListRetriever.ImageIndex(x.IconName))
            .WithValues(x => _presenter.AllValueOriginDeterminationMethods)
            .AndDisplays(x => x.Display);

            _descriptionElement = _screenBinder.Bind(x => x.Description)
                                  .To(mruDescription);
        }
コード例 #6
0
        public override void InitializeBinding()
        {
            _screenBinder = new ScreenBinder <SimpleProtocolDTO> {
                BindingMode = BindingMode.OneWay
            };

            _screenBinder.Bind(x => x.Dose).To(uxDose);
            uxDose.RegisterEditParameterEvents(_presenter);

            _screenBinder.Bind(x => x.EndTime).To(uxEndTime);
            uxEndTime.RegisterEditParameterEvents(_presenter);

            _screenBinder.Bind(x => x.ApplicationType)
            .To(cbApplicationType)
            .WithImages(x => _imageListRetriever.ImageIndex(x.IconName))
            .WithValues(x => _presenter.AllApplications())
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetApplicationType(e.NewValue));

            _screenBinder.Bind(x => x.DosingInterval)
            .To(cbDosingType)
            .WithValues(x => _presenter.AllDosingIntervals())
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetDosingInterval(e.NewValue));

            _screenBinder.Bind(x => x.TargetOrgan)
            .To(cbTargetOrgan)
            .WithImages(o => _imageListRetriever.ImageIndex(o))
            .WithValues(dto => _presenter.AllOrgans())
            .AndDisplays(o => _presenter.DisplayFor(o))
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetTargetOrgan(e.NewValue));

            _screenBinder.Bind(x => x.TargetCompartment)
            .To(cbTargetCompartment)
            .WithImages(c => _imageListRetriever.ImageIndex(c))
            .WithValues(dto => _presenter.AllCompartmentsFor(dto.TargetOrgan))
            .AndDisplays(c => _presenter.DisplayFor(c))
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SetTargetCompartment(e.NewValue));

            RegisterValidationFor(_screenBinder, NotifyViewChanged);
        }
コード例 #7
0
        public override void InitializeBinding()
        {
            _screenBinder.Bind(x => x.BuildingBlock)
            .To(cbBuildingBlocks)
            .WithImages(x => _imageListRetriever.ImageIndex(_presenter.IconFor(x)))
            .WithValues(x => _presenter.AllAvailableBlocks)
            .AndDisplays(block => _presenter.DisplayFor(block));

            RegisterValidationFor(_screenBinder);

            _screenBinder.Changed        += () => _presenter.ViewChanged();
            btnCreateBuildingBlock.Click += (o, e) => OnEvent(_presenter.CreateBuildingBlock);
            btnLoadBuildingBlock.Click   += (o, e) => OnEvent(_presenter.LoadBuildingBlockAsync);
        }
コード例 #8
0
        public override void InitializeBinding()
        {
            _screenBinder.Bind(x => x.ProcessTypeDisplayName)
            .To(lblProcessType);

            _screenBinder.Bind(x => x.Species)
            .To(cbSpecies)
            .WithImages(s => _imageListRetriever.ImageIndex(s.Icon))
            .WithValues(dto => _presenter.AllSpecies())
            .AndDisplays(s => s.DisplayName)
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.SpeciesChanged(e.NewValue));

            _screenBinder.Bind(x => x.Description)
            .To(tbDescription)
            .OnValueUpdating += (o, e) => OnEvent(() => _presenter.DescriptionChanged(e.NewValue));
        }
コード例 #9
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();

            _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);
        }
コード例 #10
0
        public override void InitializeBinding()
        {
            base.InitializeBinding();
            _screenBinder.Bind(dto => dto.Species)
            .To(cbSpecies)
            .WithImages(species => _imageListRetriever.ImageIndex(species.Icon))
            .WithValues(dto => dto.AllSpecies)
            .AndDisplays(species => species.DisplayName);

            _screenBinder.Bind(x => x.MoleculeName)
            .To(cbMoleculeName);

            _screenBinder.Bind(x => x.Category)
            .To(cbCategory);

            RegisterValidationFor(_screenBinder, NotifyViewChanged);
        }
        public override void InitializeBinding()
        {
            base.InitializeBinding();

            _screenBinder.Bind(dto => dto.Species)
            .To(cbSpecies)
            .WithImages(species => _imageListRetriever.ImageIndex(species.Icon))
            .WithValues(dto => dto.AllSpecies)
            .AndDisplays(species => species.DisplayName)
            .Changed += () => _presenter.SpeciesChanged();

            _screenBinder.Bind(dto => dto.MoleculeName)
            .To(cbMoleculeName);

            _screenBinder.Bind(dto => dto.Category)
            .To(tbCategory);


            btnLoadFromDatabase.Click += (ot, e) => OnEvent(_presenter.LoadExpressionFromDatabaseQuery);
            RegisterValidationFor(_screenBinder, statusChangingNotify: NotifyViewChanged);
        }
コード例 #12
0
        private RepositoryItem getTargetRepository(SchemaItemTargetDTO schemaItemTargetDTO, BaseView baseView)
        {
            var repositoryItemImageComboBox = new UxRepositoryItemImageComboBox(baseView, _imageListRetriever);

            repositoryItemImageComboBox.FillImageComboBoxRepositoryWith(_presenter.AllTargetsFor(schemaItemTargetDTO), s => _imageListRetriever.ImageIndex(s), _presenter.DisplayFor);
            return(repositoryItemImageComboBox);
        }
コード例 #13
0
 private RepositoryItem configureApplicationRepository(UxRepositoryItemImageComboBox applicationRepository)
 {
     applicationRepository.FillImageComboBoxRepositoryWith(_presenter.AllApplications(), app => _imageListRetriever.ImageIndex(app.IconName));
     return(applicationRepository);
 }
コード例 #14
0
 private RepositoryItem applicationDisplay(ApplicationDTO applicationDTO, UxRepositoryItemImageComboBox uxRepositoryImageComboEdit)
 {
     uxRepositoryImageComboEdit.Items.Clear();
     uxRepositoryImageComboEdit.Items.Add(new ImageComboBoxItem(applicationDTO.Name, _imageListRetriever.ImageIndex(applicationDTO.Icon)));
     return(uxRepositoryImageComboEdit);
 }
コード例 #15
0
 private RepositoryItem configureContainerRepository(PathElementDTO parameterPathDTO)
 {
     _containerDisplayNameRepository.Items.Clear();
     _containerDisplayNameRepository.Items.Add(new ImageComboBoxItem(parameterPathDTO, _imageListRetriever.ImageIndex(parameterPathDTO.IconName)));
     return(_containerDisplayNameRepository);
 }
コード例 #16
0
 public UxRepositoryItemImageComboBox AddItem(object value, ApplicationIcon icon, string display = null)
 {
     return(AddItem(value, _imageListRetriever.ImageIndex(icon), display));
 }
コード例 #17
0
        public override void InitializeBinding()
        {
            _screenBinder = new ScreenBinder <IUserSettings>();

            _screenBinder.Bind(x => x.AllowsScientifcNotation)
            .To(chkAllowsScientificNotation)
            .WithCaption(PKSimConstants.UI.AllowsScientificNotation);

            _screenBinder.Bind(x => x.ShouldRestoreWorkspaceLayout)
            .To(chkShouldRestoreWorkspaceLayout)
            .WithCaption(PKSimConstants.UI.ShouldRestoreWorkspaceLayout);

            _screenBinder.Bind(x => x.ShowUpdateNotification)
            .To(chkShowUpdateNotification)
            .WithCaption(PKSimConstants.UI.ShowUpdateNotification);

            _screenBinder.Bind(x => x.ActiveSkin)
            .To(cbActiveSkin)
            .WithValues(x => _presenter.AvailableSkins);

            _screenBinder.Bind(x => x.IconSizeTreeView)
            .To(cbIconSizeTreeView)
            .WithValues(x => _presenter.AvailableIconSizes);

            _screenBinder.Bind(x => x.IconSizeTab)
            .To(cbIconSizeTab)
            .WithValues(x => _presenter.AvailableIconSizes);

            _screenBinder.Bind(x => x.IconSizeContextMenu)
            .To(cbIconSizeContextMenu)
            .WithValues(x => _presenter.AvailableIconSizes);

            _screenBinder.Bind(x => x.DefaultSpecies)
            .To(cbDefaultSpecies)
            .WithImages(species => _imageListRetriever.ImageIndex(species))
            .WithValues(x => _presenter.AllSpecies())
            .AndDisplays(x => _presenter.AllSpeciesDisplayName())
            .Changed += () => _presenter.SpeciesChanged();

            _screenBinder.Bind(x => x.DefaultPopulation)
            .To(cbDefaultPopulation)
            .WithValues(x => _presenter.AllPopulationsFor(x.DefaultSpecies))
            .AndDisplays(x => _presenter.AllPopulationsDisplayName(x.DefaultSpecies));

            _screenBinder.Bind(x => x.DefaultParameterGroupingMode)
            .To(cbDefaultParameterGroupingMode)
            .WithValues(x => _presenter.AllParameterGroupingMode())
            .AndDisplays(x => _presenter.AllParameterGroupingModeDisplay());

            _screenBinder.Bind(x => x.AbsTol).To(tbAbsTol);
            _screenBinder.Bind(x => x.RelTol).To(tbRelTol);
            _screenBinder.Bind(x => x.NumberOfBins).To(tbNumberOfBins);
            _screenBinder.Bind(x => x.NumberOfIndividualsPerBin).To(tbNumberOfIndividualsPerBin);
            _screenBinder.Bind(x => x.DecimalPlace).To(tbDecimalPlace);
            _screenBinder.Bind(x => x.MaximumNumberOfCoresToUse).To(tbNumberOfProcessors);

            _screenBinder.Bind(x => x.MRUListItemCount).To(tbMRUListItemCount);
            _screenBinder.Bind(x => x.TemplateDatabasePath).To(tbTemplateDatabase);
            _screenBinder.Bind(x => x.ChangedColor).To(colorChanged);
            _screenBinder.Bind(x => x.FormulaColor).To(colorFormula);
            _screenBinder.Bind(x => x.DisabledColor).To(colorDisabled);
            _screenBinder.Bind(x => x.ChartDiagramBackColor).To(colorChartDiagramBack);
            _screenBinder.Bind(x => x.ChartBackColor).To(colorChartBack);
            _screenBinder.Bind(x => x.DefaultFractionUnboundName).To(cbDefaultFuName);
            _screenBinder.Bind(x => x.DefaultLipophilicityName).To(cbDefaultLipoName);
            _screenBinder.Bind(x => x.DefaultSolubilityName).To(cbDefaultSolName);

            _screenBinder.Bind(x => x.DefaultPopulationAnalysis)
            .To(cbDefaultPopulationAnalysis)
            .WithImages(populationAnalysisType => _imageListRetriever.ImageIndex(_presenter.PopulationIconNameFor(populationAnalysisType)))
            .WithValues(x => _presenter.AllPopulationAnalyses())
            .AndDisplays(_presenter.PopulationAnalysesDisplayFor);

            _screenBinder.Bind(x => x.DefaultChartYScaling)
            .To(cbPreferredChartYScaling)
            .WithValues(x => _presenter.AllScalings());

            _screenBinder.Bind(x => x.PreferredViewLayout)
            .To(cbPreferredVewLayout)
            .WithValues(x => _presenter.AllViewLayouts());

            RegisterValidationFor(_screenBinder, NotifyViewChanged);
            _screenBinder.Changed += NotifyViewChanged;

            tbTemplateDatabase.ButtonClick += (o, e) => OnEvent(() => templateDatabaseButtonClick(o, e));
        }