public int ImageIndexFor(ValidationMessage validationMessage)
        {
            if (validationMessage.NotificationType == NotificationType.Error)
            {
                return(ApplicationIcons.IconIndex(ApplicationIcons.Error));
            }

            return(ApplicationIcons.IconIndex(ApplicationIcons.Warning));
        }
Esempio n. 2
0
        public override void InitializeBinding()
        {
            _screenBinder.Bind(x => x.CurrentSelection)
            .To(cbSelection)
            .WithImages(x => ApplicationIcons.IconIndex(x.Icon))
            .WithValues(x => _presenter.AvailableSelectOptions)
            .AndDisplays(x => x.Caption);

            btnSelection.Click += (o, e) => OnEvent(_presenter.PerformSelectionHandler);
        }
Esempio n. 3
0
 private void initializeButton(BarButtonItem barButtonItem, NotificationType notificationType, ApplicationIcon icon, string caption)
 {
     barButtonItem.Tag         = caption;
     barButtonItem.ImageIndex  = ApplicationIcons.IconIndex(icon);
     barButtonItem.PaintStyle  = BarItemPaintStyle.CaptionGlyph;
     barButtonItem.ButtonStyle = BarButtonStyle.Check;
     barButtonItem.ItemClick  += (o, e) => OnEvent(() => toggleView(notificationType));
     _buttonCache.Add(notificationType, barButtonItem);
     SetNotificationCount(notificationType, 0);
 }
Esempio n. 4
0
        public void AddSelectionView(IResizableView view, string caption, ApplicationIcon icon)
        {
            var group             = layoutMainGroup.AddGroup();
            var layoutControlItem = group.AddItem();

            layoutControlItem.Control             = view.DowncastTo <Control>();
            layoutControlItem.TextVisible         = false;
            layoutControlItem.SizeConstraintsType = SizeConstraintsType.Custom;
            group.Text = caption;
            group.CaptionImageIndex = ApplicationIcons.IconIndex(icon);
            view.HeightChanged     += (o, e) => adjustLayoutItemSize(layoutControlItem, view, e.Height);
        }
        private void initializeButton(BarButtonItem barButtonItem, ApplicationIcon icon, string caption, Action clickAction, string toolTipText)
        {
            barButtonItem.Caption     = caption;
            barButtonItem.ImageIndex  = ApplicationIcons.IconIndex(icon);
            barButtonItem.PaintStyle  = BarItemPaintStyle.CaptionGlyph;
            barButtonItem.ButtonStyle = BarButtonStyle.Check;
            barButtonItem.ItemClick  += (o, e) => clickAction();
            var toolTip = new SuperToolTip();

            toolTip.Setup(new SuperToolTipSetupArgs {
                Contents = { Text = toolTipText }
            });
            barButtonItem.SuperTip = toolTip;
        }
Esempio n. 6
0
 private void initializeNanOptions()
 {
     actionImageComboBoxEdit.Properties.Items.Clear();
     actionImageComboBoxEdit.Properties.Items.Add(new ImageComboBoxItem(NanSettings.ActionType.IgnoreRow)
     {
         Description = Captions.Importer.NanActionIgnoreRow,
         ImageIndex  = ApplicationIcons.IconIndex(ApplicationIcons.UncheckAll)
     });
     actionImageComboBoxEdit.Properties.Items.Add(new ImageComboBoxItem(NanSettings.ActionType.Throw)
     {
         Description = Captions.Importer.NanActionThrowsError,
         ImageIndex  = ApplicationIcons.IconIndex(ApplicationIcons.Exit)
     });
     actionImageComboBoxEdit.SelectedIndex = 0;
 }
        protected LayoutControlItem AddViewToGroup(LayoutControlGroup group, IView view)
        {
            var layoutControlItem = group.AddItem();

            group.Text = view.Caption;
            if (view.ApplicationIcon != null)
            {
                group.CaptionImageIndex = ApplicationIcons.IconIndex(view.ApplicationIcon);
            }

            AddViewTo(layoutControlItem, view);

            layoutControlItem.TextVisible = false;

            return(layoutControlItem);
        }
Esempio n. 8
0
        public override void InitializeResources()
        {
            base.InitializeResources();
            initializeButton(btnErrors, NotificationType.Error, ApplicationIcons.Error, AppConstants.Captions.Errors);
            initializeButton(btnMessages, NotificationType.Info, ApplicationIcons.Info, AppConstants.Captions.Messages);
            initializeButton(btnWarnings, NotificationType.Warning, ApplicationIcons.Warning, AppConstants.Captions.Warnings);
            initializeButton(btnDebug, NotificationType.Debug, ApplicationIcons.Debug, AppConstants.Captions.Debug);

            if (!_runOptions.IsDeveloperMode)
            {
                btnDebug.Visibility = BarItemVisibility.Never;
            }

            btnExportToFile.ImageIndex = ApplicationIcons.IconIndex(ApplicationIcons.Save);
            btnExportToFile.PaintStyle = BarItemPaintStyle.CaptionGlyph;
            btnExportToFile.Caption    = AppConstants.Captions.SaveToFile;
            btnExportToFile.ItemClick += (o, e) => this.DoWithinExceptionHandler(() => _presenter.ExportToFile());
        }
Esempio n. 9
0
 public int ImageIndex(string imageName)
 {
     Start();
     return(ApplicationIcons.IconIndex(imageName));
 }
Esempio n. 10
0
 private RepositoryItem projectBuildingBlockRepository(BuildingBlockMappingDTO buildingBlockMappingDTO)
 {
     _repositoryForProjectBuildingBlock.FillImageComboBoxRepositoryWith(buildingBlockMappingDTO.AllAvailableBuildingBlocks, dto => ApplicationIcons.IconIndex(buildingBlockMappingDTO.BuildingBlockIcon));
     return(_repositoryForProjectBuildingBlock);
 }
Esempio n. 11
0
 public void InitializeWith(RegionName regionName)
 {
     Text       = regionName.Caption;
     ImageIndex = ApplicationIcons.IconIndex(regionName.Icon);
 }
 private void initializeButton(BarButtonItem button, ApplicationIcon icon, string caption)
 {
    button.Caption = caption;
    button.ImageIndex = ApplicationIcons.IconIndex(icon);
    button.PaintStyle = BarItemPaintStyle.CaptionGlyph;
 }
Esempio n. 13
0
 protected void RegisterRegion(DockPanel dockPanel, RegionName regionName)
 {
     IoC.RegisterImplementationOf((IRegion)dockPanel, regionName.Name);
     dockPanel.Text       = regionName.Caption;
     dockPanel.ImageIndex = ApplicationIcons.IconIndex(regionName.Icon);
 }
        public IEnumerable <RowOptionDTO> GetAvailableRowsFor(ColumnMappingDTO model)
        {
            var options = new List <RowOptionDTO>();

            if (model == null)
            {
                return(options);
            }
            var excelColumns = availableColumns();
            var topNames     = new List <string>();

            if (model.CurrentColumnType == ColumnMappingDTO.ColumnType.MetaData)
            {
                var metaDataCategory = _metaDataCategories.FirstOrDefault(md => md.Name == model.MappingName);
                if (columnNameHasManualInput(model, metaDataCategory))
                {
                    options.Add(new RowOptionDTO()
                    {
                        Description = model.ExcelColumn, ImageIndex = ApplicationIcons.IconIndex(ApplicationIcons.MetaData)
                    });
                }
                if (metaDataCategory != null && metaDataCategory.ShouldListOfValuesBeIncluded)
                {
                    options.AddRange(metaDataCategory.ListOfValues.Keys.Select(v =>
                    {
                        metaDataCategory.ListOfImages.TryGetValue(v, out var value);
                        if (value != null)
                        {
                            return new RowOptionDTO()
                            {
                                Description = v, ImageIndex = ApplicationIcons.IconIndex(value)
                            }
                        }
                        ;

                        var iconIndex = ApplicationIcons.IconIndex(v);
                        if (iconIndex == -1)
                        {
                            iconIndex = ApplicationIcons.IconIndex(ApplicationIcons.MetaData);
                        }
                        return(new RowOptionDTO()
                        {
                            Description = v, ImageIndex = iconIndex
                        });
                    }));
                }

                topNames = metaDataCategory.TopNames;
            }

            if (model.Source != null && (model.CurrentColumnType == ColumnMappingDTO.ColumnType.MetaData &&
                                         (model.Source as MetaDataFormatParameter).IsColumn))
            {
                options.Add(new RowOptionDTO()
                {
                    Description = model.Source.ColumnName, ImageIndex = ApplicationIcons.IconIndex(ApplicationIcons.ObservedDataForMolecule)
                });
            }
            else if (model.Source != null && !(model.Source is AddGroupByFormatParameter) && !(model.Source is MetaDataFormatParameter))
            {
                options.Add(new RowOptionDTO()
                {
                    Description = model.Source.ColumnName, ImageIndex = ApplicationIcons.IconIndex(ApplicationIcons.ObservedDataForMolecule)
                });
            }

            if (model.CurrentColumnType == ColumnMappingDTO.ColumnType.AddGroupBy)
            {
                options.Add(new RowOptionDTO()
                {
                    Description = model.ExcelColumn, ImageIndex = ApplicationIcons.IconIndex(ApplicationIcons.Add)
                });
            }

            options.AddRange(excelColumns.Select(c => new RowOptionDTO()
            {
                Description = c, ImageIndex = ApplicationIcons.IconIndex(ApplicationIcons.ObservedDataForMolecule)
            }));
            var metaDataIconIndex = ApplicationIcons.IconIndex(ApplicationIcons.ObservedDataForMolecule);

            return(options.OrderByDescending(o => topNames.Contains(o.Description)).ThenBy(o => o.ImageIndex == metaDataIconIndex)
                   .ThenBy(o => o.Description));
        }