diff --git a/src/MoBi.Presentation/DTO/ContainerDTO.cs b/src/MoBi.Presentation/DTO/ContainerDTO.cs index 18063c765..ca2b9eb10 100644 --- a/src/MoBi.Presentation/DTO/ContainerDTO.cs +++ b/src/MoBi.Presentation/DTO/ContainerDTO.cs @@ -1,16 +1,9 @@ -using System.Collections.Generic; using OSPSuite.Core.Domain; namespace MoBi.Presentation.DTO { - public interface ITaggedEntityDTO + public class ContainerDTO : ObjectBaseDTO { - IList Tags { set; get; } - } - - public class ContainerDTO : ObjectBaseDTO, ITaggedEntityDTO - { - public IList Tags { set; get; } public ContainerMode Mode { set; get; } public ContainerType ContainerType { get; set; } } diff --git a/src/MoBi.Presentation/DTO/ParameterDTO.cs b/src/MoBi.Presentation/DTO/ParameterDTO.cs index 61a7acaec..7c07f8f04 100644 --- a/src/MoBi.Presentation/DTO/ParameterDTO.cs +++ b/src/MoBi.Presentation/DTO/ParameterDTO.cs @@ -8,21 +8,19 @@ using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Formulas; using OSPSuite.Core.Domain.UnitSystem; -using OSPSuite.Presentation.DTO; using OSPSuite.Utility.Collections; using OSPSuite.Utility.Extensions; using OSPSuite.Utility.Validation; namespace MoBi.Presentation.DTO { - public class ParameterDTO : ObjectBaseDTO, ITaggedEntityDTO, IMoBiParameterDTO + public class ParameterDTO : ObjectBaseDTO, IMoBiParameterDTO { public bool HasRHS { get; set; } public FormulaBuilderDTO RHSFormula { get; set; } public FormulaBuilderDTO Formula { get; set; } public IParameter Parameter { get; private set; } public bool IsAdvancedParameter { get; set; } - public IList Tags { get; set; } public IGroup Group { get; set; } public bool CanBeVariedInPopulation { get; set; } public bool IsFavorite { get; set; } diff --git a/src/MoBi.Presentation/Mappers/ContainerToContainerDTOMapper.cs b/src/MoBi.Presentation/Mappers/ContainerToContainerDTOMapper.cs index 85eb81ceb..c685772be 100644 --- a/src/MoBi.Presentation/Mappers/ContainerToContainerDTOMapper.cs +++ b/src/MoBi.Presentation/Mappers/ContainerToContainerDTOMapper.cs @@ -1,8 +1,7 @@ -using OSPSuite.Utility; -using OSPSuite.Utility.Extensions; -using MoBi.Core.Repositories; +using MoBi.Core.Repositories; using MoBi.Presentation.DTO; using OSPSuite.Core.Domain; +using OSPSuite.Utility; namespace MoBi.Presentation.Mappers { @@ -12,12 +11,10 @@ public interface IContainerToContainerDTOMapper : IMapper(); - dto.Transports = tranports.MapAllUsing(_transportToTransportDTOMapper); + var transports = neighborhood.GetAllChildren(); + dto.Transports = transports.MapAllUsing(_transportToTransportDTOMapper); return dto; } } - - - - - - } \ No newline at end of file diff --git a/src/MoBi.Presentation/Mappers/ParameterToParameterDTOMapper.cs b/src/MoBi.Presentation/Mappers/ParameterToParameterDTOMapper.cs index e1acd525d..12d8efb53 100644 --- a/src/MoBi.Presentation/Mappers/ParameterToParameterDTOMapper.cs +++ b/src/MoBi.Presentation/Mappers/ParameterToParameterDTOMapper.cs @@ -4,7 +4,6 @@ using OSPSuite.Core.Domain.Repositories; using OSPSuite.Core.Domain.Services; using OSPSuite.Presentation.DTO; -using OSPSuite.Utility.Extensions; namespace MoBi.Presentation.Mappers { @@ -15,21 +14,18 @@ public interface IParameterToParameterDTOMapper : OSPSuite.Presentation.Mappers. public class ParameterToParameterDTOMapper : ObjectBaseToObjectBaseDTOMapperBase, IParameterToParameterDTOMapper { private readonly IFormulaToFormulaBuilderDTOMapper _formulaToDTOFormulaBuilderMapper; - private readonly ITagToTagDTOMapper _tagMapper; private readonly IGroupRepository _groupRepository; private readonly IFavoriteRepository _favoriteRepository; private readonly IEntityPathResolver _entityPathResolver; private readonly IPathToPathElementsMapper _pathToPathElementsMapper; - public ParameterToParameterDTOMapper(IFormulaToFormulaBuilderDTOMapper formulaToDTOFormulaBuilderMapper, - ITagToTagDTOMapper tagMapper, - IGroupRepository groupRepository, - IFavoriteRepository favoriteRepository, - IEntityPathResolver entityPathResolver, + public ParameterToParameterDTOMapper(IFormulaToFormulaBuilderDTOMapper formulaToDTOFormulaBuilderMapper, + IGroupRepository groupRepository, + IFavoriteRepository favoriteRepository, + IEntityPathResolver entityPathResolver, IPathToPathElementsMapper pathToPathElementsMapper) { _formulaToDTOFormulaBuilderMapper = formulaToDTOFormulaBuilderMapper; - _tagMapper = tagMapper; _groupRepository = groupRepository; _favoriteRepository = favoriteRepository; _entityPathResolver = entityPathResolver; @@ -50,7 +46,6 @@ public IParameterDTO MapFrom(IParameter parameter) dto.IsAdvancedParameter = !parameter.Visible; dto.CanBeVariedInPopulation = parameter.CanBeVariedInPopulation; dto.PathElements = _pathToPathElementsMapper.MapFrom(parameter); - dto.Tags = parameter.Tags.MapAllUsing(_tagMapper).ToRichList(); var parameterPath = _entityPathResolver.ObjectPathFor(parameter); dto.IsFavorite = _favoriteRepository.Contains(parameterPath); diff --git a/src/MoBi.Presentation/Presenter/EditContainerPresenter.cs b/src/MoBi.Presentation/Presenter/EditContainerPresenter.cs index 230f8c711..6561cc4fe 100644 --- a/src/MoBi.Presentation/Presenter/EditContainerPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditContainerPresenter.cs @@ -10,7 +10,6 @@ using MoBi.Presentation.DTO; using MoBi.Presentation.Mappers; using MoBi.Presentation.Presenter.BasePresenter; -using MoBi.Presentation.Tasks; using MoBi.Presentation.Tasks.Edit; using MoBi.Presentation.Views; using OSPSuite.Core.Domain; @@ -23,8 +22,6 @@ public interface IEditContainerPresenter : ICanEditPropertiesPresenter, IPresent { EditParameterMode EditMode { set; } bool ReadOnly { set; } - void AddNewTag(); - void RemoveTag(TagDTO tagDTO); void SetInitialName(string initialName); string ContainerModeDisplayFor(ContainerMode mode); IEnumerable AllContainerModes(); @@ -39,20 +36,26 @@ public class EditContainerPresenter : AbstractEntityEditPresenter AllContainerTypes() public IBuildingBlock BuildingBlock { - get { return _editParametersInContainerPresenter.BuildingBlock; } - set { _editParametersInContainerPresenter.BuildingBlock = value; } + get => _editParametersInContainerPresenter.BuildingBlock; + set + { + _editParametersInContainerPresenter.BuildingBlock = value; + _tagsPresenter.BuildingBlock = value; + } } - public IFormulaCache FormulaCache - { - get { return BuildingBlock.FormulaCache; } - } + public IFormulaCache FormulaCache => BuildingBlock.FormulaCache; public void SelectParameter(IParameter childParameter) { @@ -137,39 +141,25 @@ public override void Edit(IContainer container, IEnumerable existin _containerDTO.AddUsedNames(_editTasks.GetForbiddenNamesWithoutSelf(container, existingObjectsInParent)); _editParametersInContainerPresenter.Edit(_container); _view.BindTo(_containerDTO); + _tagsPresenter.Edit(container); _view.ContainerPropertiesEditable = !container.IsMoleculeProperties(); } - public override object Subject - { - get { return _container; } - } + public override object Subject => _container; public EditParameterMode EditMode { - set { _editParametersInContainerPresenter.EditMode = value; } + set => _editParametersInContainerPresenter.EditMode = value; } public bool ReadOnly { - set { _view.ReadOnly = value; } - } - - public void AddNewTag() - { - //TODO - AddCommand(_entityTask.AddNewTagTo(_container, BuildingBlock)); - } - - public void RemoveTag(TagDTO tagDTO) - { - AddCommand(_entityTask.RemoveTagFrom(tagDTO, _container, BuildingBlock)); - _containerDTO.Tags.Remove(tagDTO); + set => _view.ReadOnly = value; } public void SetInitialName(string initialName) { - SetPropertyValueFromView(_container.PropertyName(x => x.Name), initialName, String.Empty); + SetPropertyValueFromView(_container.PropertyName(x => x.Name), initialName, string.Empty); _containerDTO.Name = initialName; } } diff --git a/src/MoBi.Presentation/Presenter/EditEventGroupPresenter.cs b/src/MoBi.Presentation/Presenter/EditEventGroupPresenter.cs index cfca268b1..8c57754a4 100644 --- a/src/MoBi.Presentation/Presenter/EditEventGroupPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditEventGroupPresenter.cs @@ -25,6 +25,7 @@ internal class EditEventGroupPresenter : AbstractEntityEditPresenter _descriptorConditionListPresenter; + private readonly ITagsPresenter _tagsPresenter; private readonly IEditParametersInContainerPresenter _parametersInContainerPresenter; private IBuildingBlock _buildingBlock; @@ -34,17 +35,20 @@ public EditEventGroupPresenter( IEditParametersInContainerPresenter parametersInContainerPresenter, IEventGroupBuilderToEventGroupBuilderDTOMapper eventGroupBuilderDTOMapper, IMoBiContext context, - IDescriptorConditionListPresenter descriptorConditionListPresenter) + IDescriptorConditionListPresenter descriptorConditionListPresenter, + ITagsPresenter tagsPresenter) : base(view) { _descriptorConditionListPresenter = descriptorConditionListPresenter; + _tagsPresenter = tagsPresenter; _context = context; _eventGroupBuilderDTOMapper = eventGroupBuilderDTOMapper; _parametersInContainerPresenter = parametersInContainerPresenter; _view.AddParametersView(parametersInContainerPresenter.BaseView); _view.AddDescriptorConditionListView(_descriptorConditionListPresenter.View); + _view.AddTagsView(_tagsPresenter.View); _editTask = editTask; - AddSubPresenters(_parametersInContainerPresenter, _descriptorConditionListPresenter); + AddSubPresenters(_parametersInContainerPresenter, _descriptorConditionListPresenter, _tagsPresenter); } public override void Edit(IEventGroupBuilder eventGroupBuilder, IEnumerable existingObjectsInParent) @@ -55,6 +59,7 @@ public override void Edit(IEventGroupBuilder eventGroupBuilder, IEnumerable x.SourceCriteria, _buildingBlock); } @@ -89,6 +94,7 @@ public IBuildingBlock BuildingBlock { _buildingBlock = value; _parametersInContainerPresenter.BuildingBlock = value; + _tagsPresenter.BuildingBlock = value; } } diff --git a/src/MoBi.Presentation/Presenter/TagsPresenter.cs b/src/MoBi.Presentation/Presenter/TagsPresenter.cs index 90638b502..a478708e3 100644 --- a/src/MoBi.Presentation/Presenter/TagsPresenter.cs +++ b/src/MoBi.Presentation/Presenter/TagsPresenter.cs @@ -11,6 +11,8 @@ namespace MoBi.Presentation.Presenter { + //AppConstants.Captions.ContainerTags.FormatForLabel + public interface ITagsPresenter : IEditPresenter, IPresenter { void AddNewTag(); diff --git a/src/MoBi.Presentation/Views/IEditContainerView.cs b/src/MoBi.Presentation/Views/IEditContainerView.cs index 9c543b685..86479f8b4 100644 --- a/src/MoBi.Presentation/Views/IEditContainerView.cs +++ b/src/MoBi.Presentation/Views/IEditContainerView.cs @@ -7,7 +7,8 @@ namespace MoBi.Presentation.Views public interface IEditContainerView : IView, IActivatableView { void BindTo(ContainerDTO dto); - void SetParameterView(IView view); + void AddParameterView(IView view); + void AddTagsView(IView view); bool ReadOnly { get; set; } bool ContainerPropertiesEditable { get; set; } void ShowParameters(); diff --git a/src/MoBi.Presentation/Views/IEditEventGroupView.cs b/src/MoBi.Presentation/Views/IEditEventGroupView.cs index 3b7787b32..a983ff330 100644 --- a/src/MoBi.Presentation/Views/IEditEventGroupView.cs +++ b/src/MoBi.Presentation/Views/IEditEventGroupView.cs @@ -11,5 +11,6 @@ public interface IEditEventGroupView : IView, IActivat bool EnableDescriptors { get; set; } void ShowParameters(); void AddDescriptorConditionListView(IView view); + void AddTagsView(IView view); } } \ No newline at end of file diff --git a/src/MoBi.UI/Properties/licenses.licx b/src/MoBi.UI/Properties/licenses.licx index 5a219c93f..8c40a513d 100644 --- a/src/MoBi.UI/Properties/licenses.licx +++ b/src/MoBi.UI/Properties/licenses.licx @@ -1,3 +1,4 @@ DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v20.1, Version=20.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v20.1, Version=20.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v20.1, Version=20.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v20.1, Version=20.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/src/MoBi.UI/Views/EditContainerView.Designer.cs b/src/MoBi.UI/Views/EditContainerView.Designer.cs index 84f29c081..44d35383a 100644 --- a/src/MoBi.UI/Views/EditContainerView.Designer.cs +++ b/src/MoBi.UI/Views/EditContainerView.Designer.cs @@ -20,7 +20,6 @@ protected override void Dispose(bool disposing) components.Dispose(); } _screenBinder.Dispose(); - _gridBinder.Dispose(); base.Dispose(disposing); } @@ -34,41 +33,34 @@ protected virtual void InitializeComponent() { this.tabProperties = new DevExpress.XtraTab.XtraTabPage(); this.layoutControl = new OSPSuite.UI.Controls.UxLayoutControl(); + this.panelTags = new DevExpress.XtraEditors.PanelControl(); this.cbContainerMode = new DevExpress.XtraEditors.ComboBoxEdit(); this.htmlEditor = new DevExpress.XtraEditors.MemoExEdit(); this.btName = new DevExpress.XtraEditors.ButtonEdit(); - this.gridControl = new OSPSuite.UI.Controls.UxGridControl(); - this.gridView = new MoBi.UI.Views.UxGridView(); - this.btAddTag = new DevExpress.XtraEditors.SimpleButton(); this.cbContainerType = new DevExpress.XtraEditors.ComboBoxEdit(); this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutItemDescription = new DevExpress.XtraLayout.LayoutControlItem(); - this.layoutItemGrid = new DevExpress.XtraLayout.LayoutControlItem(); - this.layoutItemContainerTags = new DevExpress.XtraLayout.LayoutControlItem(); - this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); this.layoutItemContainerType = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutItemContainerMode = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutItemName = new DevExpress.XtraLayout.LayoutControlItem(); + this.layoutControlItemTab = new DevExpress.XtraLayout.LayoutControlItem(); this.tabPagesControl = new DevExpress.XtraTab.XtraTabControl(); this.tabParameters = new DevExpress.XtraTab.XtraTabPage(); ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); this.tabProperties.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.layoutControl)).BeginInit(); this.layoutControl.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.panelTags)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cbContainerMode.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.htmlEditor.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.btName.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.gridControl)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.gridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cbContainerType.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemDescription)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.layoutItemGrid)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.layoutItemContainerTags)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemContainerType)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemContainerMode)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemName)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItemTab)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tabPagesControl)).BeginInit(); this.tabPagesControl.SuspendLayout(); this.SuspendLayout(); @@ -77,33 +69,40 @@ protected virtual void InitializeComponent() // this.tabProperties.Controls.Add(this.layoutControl); this.tabProperties.Name = "tabProperties"; - this.tabProperties.Size = new System.Drawing.Size(874, 589); + this.tabProperties.Size = new System.Drawing.Size(878, 592); this.tabProperties.Text = "Properties"; // // layoutControl // this.layoutControl.AllowCustomization = false; + this.layoutControl.Controls.Add(this.panelTags); this.layoutControl.Controls.Add(this.cbContainerMode); this.layoutControl.Controls.Add(this.htmlEditor); this.layoutControl.Controls.Add(this.btName); - this.layoutControl.Controls.Add(this.gridControl); - this.layoutControl.Controls.Add(this.btAddTag); this.layoutControl.Controls.Add(this.cbContainerType); this.layoutControl.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl.Location = new System.Drawing.Point(0, 0); this.layoutControl.Name = "layoutControl"; this.layoutControl.Root = this.layoutControlGroup1; - this.layoutControl.Size = new System.Drawing.Size(874, 589); + this.layoutControl.Size = new System.Drawing.Size(878, 592); this.layoutControl.TabIndex = 13; this.layoutControl.Text = "layoutControl1"; // + // panelTags + // + this.panelTags.Location = new System.Drawing.Point(10, 58); + this.panelTags.Margin = new System.Windows.Forms.Padding(0); + this.panelTags.Name = "panelTags"; + this.panelTags.Size = new System.Drawing.Size(858, 500); + this.panelTags.TabIndex = 14; + // // cbContainerMode // - this.cbContainerMode.Location = new System.Drawing.Point(323, 36); + this.cbContainerMode.Location = new System.Drawing.Point(324, 36); this.cbContainerMode.Name = "cbContainerMode"; this.cbContainerMode.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.cbContainerMode.Size = new System.Drawing.Size(539, 20); + this.cbContainerMode.Size = new System.Drawing.Size(542, 20); this.cbContainerMode.StyleController = this.layoutControl; this.cbContainerMode.TabIndex = 13; // @@ -111,12 +110,12 @@ protected virtual void InitializeComponent() // this.htmlEditor.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.htmlEditor.Location = new System.Drawing.Point(137, 557); + this.htmlEditor.Location = new System.Drawing.Point(91, 560); this.htmlEditor.Name = "htmlEditor"; this.htmlEditor.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); this.htmlEditor.Properties.ShowIcon = false; - this.htmlEditor.Size = new System.Drawing.Size(725, 20); + this.htmlEditor.Size = new System.Drawing.Size(775, 20); this.htmlEditor.StyleController = this.layoutControl; this.htmlEditor.TabIndex = 12; // @@ -124,52 +123,21 @@ protected virtual void InitializeComponent() // this.btName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.btName.Location = new System.Drawing.Point(137, 12); + this.btName.Location = new System.Drawing.Point(91, 12); this.btName.Name = "btName"; this.btName.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton()}); - this.btName.Size = new System.Drawing.Size(725, 20); + this.btName.Size = new System.Drawing.Size(775, 20); this.btName.StyleController = this.layoutControl; this.btName.TabIndex = 0; // - // gridControl - // - this.gridControl.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.gridControl.Location = new System.Drawing.Point(12, 86); - this.gridControl.MainView = this.gridView; - this.gridControl.Name = "gridControl"; - this.gridControl.Size = new System.Drawing.Size(850, 467); - this.gridControl.TabIndex = 0; - this.gridControl.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { - this.gridView}); - // - // gridView - // - this.gridView.AllowsFiltering = true; - this.gridView.EnableColumnContextMenu = true; - this.gridView.GridControl = this.gridControl; - this.gridView.MultiSelect = false; - this.gridView.Name = "gridView"; - this.gridView.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseDown; - this.gridView.OptionsNavigation.AutoFocusNewRow = true; - this.gridView.OptionsSelection.EnableAppearanceFocusedCell = false; - // - // btAddTag - // - this.btAddTag.Location = new System.Drawing.Point(137, 60); - this.btAddTag.Name = "btAddTag"; - this.btAddTag.Size = new System.Drawing.Size(182, 22); - this.btAddTag.StyleController = this.layoutControl; - this.btAddTag.TabIndex = 6; - this.btAddTag.Text = "btAddTag"; - // // cbContainerType // - this.cbContainerType.Location = new System.Drawing.Point(137, 36); + this.cbContainerType.Location = new System.Drawing.Point(91, 36); this.cbContainerType.Name = "cbContainerType"; this.cbContainerType.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.cbContainerType.Size = new System.Drawing.Size(182, 20); + this.cbContainerType.Size = new System.Drawing.Size(229, 20); this.cbContainerType.StyleController = this.layoutControl; this.cbContainerType.TabIndex = 4; // @@ -180,54 +148,23 @@ protected virtual void InitializeComponent() this.layoutControlGroup1.GroupBordersVisible = false; this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { this.layoutItemDescription, - this.layoutItemGrid, - this.layoutItemContainerTags, - this.emptySpaceItem1, this.layoutItemContainerType, this.layoutItemContainerMode, - this.layoutItemName}); - this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0); + this.layoutItemName, + this.layoutControlItemTab}); this.layoutControlGroup1.Name = "layoutControlGroup1"; - this.layoutControlGroup1.Size = new System.Drawing.Size(874, 589); + this.layoutControlGroup1.Size = new System.Drawing.Size(878, 592); this.layoutControlGroup1.TextVisible = false; // // layoutItemDescription // this.layoutItemDescription.Control = this.htmlEditor; this.layoutItemDescription.CustomizationFormText = "Description"; - this.layoutItemDescription.Location = new System.Drawing.Point(0, 545); + this.layoutItemDescription.Location = new System.Drawing.Point(0, 548); this.layoutItemDescription.Name = "layoutItemDescription"; - this.layoutItemDescription.Size = new System.Drawing.Size(854, 24); + this.layoutItemDescription.Size = new System.Drawing.Size(858, 24); this.layoutItemDescription.Text = "Description:"; - this.layoutItemDescription.TextSize = new System.Drawing.Size(122, 13); - // - // layoutItemGrid - // - this.layoutItemGrid.Control = this.gridControl; - this.layoutItemGrid.CustomizationFormText = "layoutItemGrid"; - this.layoutItemGrid.Location = new System.Drawing.Point(0, 74); - this.layoutItemGrid.Name = "layoutItemGrid"; - this.layoutItemGrid.Size = new System.Drawing.Size(854, 471); - this.layoutItemGrid.TextSize = new System.Drawing.Size(0, 0); - this.layoutItemGrid.TextVisible = false; - // - // layoutItemContainerTags - // - this.layoutItemContainerTags.Control = this.btAddTag; - this.layoutItemContainerTags.CustomizationFormText = "Container Tags"; - this.layoutItemContainerTags.Location = new System.Drawing.Point(0, 48); - this.layoutItemContainerTags.Name = "layoutItemContainerTags"; - this.layoutItemContainerTags.Size = new System.Drawing.Size(311, 26); - this.layoutItemContainerTags.TextSize = new System.Drawing.Size(122, 13); - // - // emptySpaceItem1 - // - this.emptySpaceItem1.AllowHotTrack = false; - this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1"; - this.emptySpaceItem1.Location = new System.Drawing.Point(311, 48); - this.emptySpaceItem1.Name = "emptySpaceItem1"; - this.emptySpaceItem1.Size = new System.Drawing.Size(543, 26); - this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); + this.layoutItemDescription.TextSize = new System.Drawing.Size(76, 13); // // layoutItemContainerType // @@ -235,17 +172,17 @@ protected virtual void InitializeComponent() this.layoutItemContainerType.CustomizationFormText = "Container Type"; this.layoutItemContainerType.Location = new System.Drawing.Point(0, 24); this.layoutItemContainerType.Name = "layoutItemContainerType"; - this.layoutItemContainerType.Size = new System.Drawing.Size(311, 24); + this.layoutItemContainerType.Size = new System.Drawing.Size(312, 24); this.layoutItemContainerType.Text = "Container type:"; - this.layoutItemContainerType.TextSize = new System.Drawing.Size(122, 13); + this.layoutItemContainerType.TextSize = new System.Drawing.Size(76, 13); // // layoutItemContainerMode // this.layoutItemContainerMode.Control = this.cbContainerMode; this.layoutItemContainerMode.CustomizationFormText = "layoutItemContainerMode"; - this.layoutItemContainerMode.Location = new System.Drawing.Point(311, 24); + this.layoutItemContainerMode.Location = new System.Drawing.Point(312, 24); this.layoutItemContainerMode.Name = "layoutItemContainerMode"; - this.layoutItemContainerMode.Size = new System.Drawing.Size(543, 24); + this.layoutItemContainerMode.Size = new System.Drawing.Size(546, 24); this.layoutItemContainerMode.TextSize = new System.Drawing.Size(0, 0); this.layoutItemContainerMode.TextVisible = false; // @@ -255,9 +192,19 @@ protected virtual void InitializeComponent() this.layoutItemName.CustomizationFormText = "Name"; this.layoutItemName.Location = new System.Drawing.Point(0, 0); this.layoutItemName.Name = "layoutItemName"; - this.layoutItemName.Size = new System.Drawing.Size(854, 24); + this.layoutItemName.Size = new System.Drawing.Size(858, 24); this.layoutItemName.Text = "Name:"; - this.layoutItemName.TextSize = new System.Drawing.Size(122, 13); + this.layoutItemName.TextSize = new System.Drawing.Size(76, 13); + // + // layoutControlItemTab + // + this.layoutControlItemTab.Control = this.panelTags; + this.layoutControlItemTab.Location = new System.Drawing.Point(0, 48); + this.layoutControlItemTab.Name = "layoutControlItemTab"; + this.layoutControlItemTab.Padding = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); + this.layoutControlItemTab.Size = new System.Drawing.Size(858, 500); + this.layoutControlItemTab.TextSize = new System.Drawing.Size(0, 0); + this.layoutControlItemTab.TextVisible = false; // // tabPagesControl // @@ -274,7 +221,7 @@ protected virtual void InitializeComponent() // tabParameters // this.tabParameters.Name = "tabParameters"; - this.tabParameters.Size = new System.Drawing.Size(874, 589); + this.tabParameters.Size = new System.Drawing.Size(878, 592); this.tabParameters.Text = "Parameters"; // // EditContainerView @@ -289,20 +236,17 @@ protected virtual void InitializeComponent() this.tabProperties.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.layoutControl)).EndInit(); this.layoutControl.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.panelTags)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cbContainerMode.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.htmlEditor.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btName.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.gridControl)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cbContainerType.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemDescription)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.layoutItemGrid)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.layoutItemContainerTags)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemContainerType)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemContainerMode)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutItemName)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.layoutControlItemTab)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tabPagesControl)).EndInit(); this.tabPagesControl.ResumeLayout(false); this.ResumeLayout(false); @@ -313,24 +257,18 @@ protected virtual void InitializeComponent() protected DevExpress.XtraTab.XtraTabPage tabProperties; protected DevExpress.XtraTab.XtraTabControl tabPagesControl; - private DevExpress.XtraGrid.GridControl gridControl; - private MoBi.UI.Views.UxGridView gridView; private DevExpress.XtraEditors.ComboBoxEdit cbContainerType; protected DevExpress.XtraTab.XtraTabPage tabParameters; - private SimpleButton btAddTag; private ButtonEdit btName; private MemoExEdit htmlEditor; private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1; private DevExpress.XtraLayout.LayoutControlItem layoutItemDescription; - private DevExpress.XtraLayout.LayoutControlItem layoutItemGrid; private ComboBoxEdit cbContainerMode; - private DevExpress.XtraLayout.LayoutControlItem layoutItemContainerTags; - private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1; private DevExpress.XtraLayout.LayoutControlItem layoutItemContainerType; private DevExpress.XtraLayout.LayoutControlItem layoutItemContainerMode; private DevExpress.XtraLayout.LayoutControlItem layoutItemName; private OSPSuite.UI.Controls.UxLayoutControl layoutControl; - - + private PanelControl panelTags; + private DevExpress.XtraLayout.LayoutControlItem layoutControlItemTab; } } diff --git a/src/MoBi.UI/Views/EditContainerView.cs b/src/MoBi.UI/Views/EditContainerView.cs index 878f96425..31b7979ca 100644 --- a/src/MoBi.UI/Views/EditContainerView.cs +++ b/src/MoBi.UI/Views/EditContainerView.cs @@ -3,14 +3,9 @@ using OSPSuite.DataBinding.DevExpress.XtraGrid; using OSPSuite.Utility.Extensions; using DevExpress.XtraEditors.Controls; -using DevExpress.XtraEditors.Repository; -using DevExpress.XtraGrid.Views.Base; -using MoBi.Assets; using MoBi.Presentation.DTO; using MoBi.Presentation.Presenter; using MoBi.Presentation.Views; -using OSPSuite.Presentation; -using OSPSuite.Presentation.Extensions; using OSPSuite.Presentation.Views; using OSPSuite.Assets; using OSPSuite.UI.Controls; @@ -22,7 +17,6 @@ namespace MoBi.UI.Views public partial class EditContainerView : BaseUserControl, IEditContainerView { protected IEditContainerPresenter _presenter; - protected GridViewBinder _gridBinder; protected ScreenBinder _screenBinder; protected bool _readOnly; @@ -53,23 +47,9 @@ public override void InitializeBinding() .To(htmlEditor) .OnValueUpdating += onValueUpdating; - _gridBinder = new GridViewBinder(gridView); - _gridBinder.Bind(dto => dto.Value) - .WithCaption(AppConstants.Captions.Tag) - .AsReadOnly(); - - var buttonRepository = createAddRemoveButtonRepository(); - buttonRepository.ButtonClick += (o, e) => OnEvent(() => onButtonClicked(e, _gridBinder.FocusedElement)); - - _gridBinder.AddUnboundColumn() - .WithCaption(OSPSuite.UI.UIConstants.EMPTY_COLUMN) - .WithShowButton(ShowButtonModeEnum.ShowAlways) - .WithRepository(dto => buttonRepository) - .WithFixedWidth(OSPSuite.UI.UIConstants.Size.EMBEDDED_BUTTON_WIDTH * 2); RegisterValidationFor(_screenBinder, NotifyViewChanged); - btAddTag.Click += (o, e) => OnEvent(_presenter.AddNewTag); btName.ButtonClick += (o, e) => OnEvent(_presenter.RenameSubject); } @@ -82,9 +62,7 @@ public override void InitializeResources() { base.InitializeResources(); - btAddTag.InitWithImage(ApplicationIcons.Add, text: AppConstants.Captions.AddTag, toolTip: ToolTips.Container.AddTag); btName.ToolTip = ToolTips.Container.ContainerName; - layoutItemContainerTags.Text = AppConstants.Captions.ContainerTags.FormatForLabel(); tabProperties.Image = ApplicationIcons.Properties; tabParameters.Image = ApplicationIcons.Parameter; } @@ -98,24 +76,7 @@ private void onValueUpdating(ContainerDTO container, PropertyValueSetEventArg { OnEvent(() => _presenter.SetPropertyValueFromView(e.PropertyName, e.NewValue, e.OldValue)); } - - private RepositoryItemButtonEdit createAddRemoveButtonRepository() - { - var buttonRepository = new RepositoryItemButtonEdit {TextEditStyle = TextEditStyles.HideTextEditor}; - buttonRepository.Buttons[0].Kind = ButtonPredefines.Plus; - buttonRepository.Buttons.Add(new EditorButton(ButtonPredefines.Delete)); - return buttonRepository; - } - - private void onButtonClicked(ButtonPressedEventArgs buttonPressedEventArgs, TagDTO tagDTO) - { - var pressedButton = buttonPressedEventArgs.Button; - if (pressedButton.Kind.Equals(ButtonPredefines.Plus)) - _presenter.AddNewTag(); - else - _presenter.RemoveTag(tagDTO); - } - + public void AttachPresenter(IEditContainerPresenter presenter) { _presenter = presenter; @@ -123,7 +84,6 @@ public void AttachPresenter(IEditContainerPresenter presenter) public virtual void BindTo(ContainerDTO dto) { - _gridBinder.BindToSource(dto.Tags); _screenBinder.BindToSource(dto); initNameControl(dto); } @@ -138,12 +98,17 @@ private void initNameControl(ContainerDTO dto) private EditorButton editNameButton => btName.Properties.Buttons[0]; - public void SetParameterView(IView view) + public void AddParameterView(IView view) { tabParameters.FillWith(view); } - public override bool HasError => base.HasError || _screenBinder.HasError || _gridBinder.HasError; + public void AddTagsView(IView view) + { + panelTags.FillWith(view); + } + + public override bool HasError => base.HasError || _screenBinder.HasError; public virtual bool ReadOnly { diff --git a/src/MoBi.UI/Views/EditEventGroupView.Designer.cs b/src/MoBi.UI/Views/EditEventGroupView.Designer.cs index 3ba13ed5b..00af0ed19 100644 --- a/src/MoBi.UI/Views/EditEventGroupView.Designer.cs +++ b/src/MoBi.UI/Views/EditEventGroupView.Designer.cs @@ -30,8 +30,8 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl(); - this.tabInfo = new DevExpress.XtraTab.XtraTabPage(); + this.tabControl = new DevExpress.XtraTab.XtraTabControl(); + this.tabProperties = new DevExpress.XtraTab.XtraTabPage(); this.grpContainerDescriptor = new DevExpress.XtraEditors.GroupControl(); this.panelDescriptorCriteria = new DevExpress.XtraEditors.PanelControl(); this.lblDescription = new DevExpress.XtraEditors.LabelControl(); @@ -39,15 +39,16 @@ private void InitializeComponent() this.lbl = new DevExpress.XtraEditors.LabelControl(); this.btName = new DevExpress.XtraEditors.ButtonEdit(); this.tabParameters = new DevExpress.XtraTab.XtraTabPage(); + this.tabTags = new DevExpress.XtraTab.XtraTabPage(); this.barManager = new DevExpress.XtraBars.BarManager(this.components); this.barDockControlTop = new DevExpress.XtraBars.BarDockControl(); this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl(); this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl(); this.barDockControlRight = new DevExpress.XtraBars.BarDockControl(); ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit(); - this.xtraTabControl1.SuspendLayout(); - this.tabInfo.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tabControl)).BeginInit(); + this.tabControl.SuspendLayout(); + this.tabProperties.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.grpContainerDescriptor)).BeginInit(); this.grpContainerDescriptor.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.panelDescriptorCriteria)).BeginInit(); @@ -56,28 +57,29 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.barManager)).BeginInit(); this.SuspendLayout(); // - // xtraTabControl1 - // - this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.xtraTabControl1.Location = new System.Drawing.Point(0, 0); - this.xtraTabControl1.Name = "xtraTabControl1"; - this.xtraTabControl1.SelectedTabPage = this.tabInfo; - this.xtraTabControl1.Size = new System.Drawing.Size(977, 583); - this.xtraTabControl1.TabIndex = 0; - this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { - this.tabInfo, - this.tabParameters}); - // - // tabInfo - // - this.tabInfo.Controls.Add(this.grpContainerDescriptor); - this.tabInfo.Controls.Add(this.lblDescription); - this.tabInfo.Controls.Add(this.htmlEditor); - this.tabInfo.Controls.Add(this.lbl); - this.tabInfo.Controls.Add(this.btName); - this.tabInfo.Name = "tabInfo"; - this.tabInfo.Size = new System.Drawing.Size(971, 555); - this.tabInfo.Text = "Info"; + // tabControl + // + this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl.Location = new System.Drawing.Point(0, 0); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedTabPage = this.tabProperties; + this.tabControl.Size = new System.Drawing.Size(977, 583); + this.tabControl.TabIndex = 0; + this.tabControl.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { + this.tabProperties, + this.tabParameters, + this.tabTags}); + // + // tabProperties + // + this.tabProperties.Controls.Add(this.grpContainerDescriptor); + this.tabProperties.Controls.Add(this.lblDescription); + this.tabProperties.Controls.Add(this.htmlEditor); + this.tabProperties.Controls.Add(this.lbl); + this.tabProperties.Controls.Add(this.btName); + this.tabProperties.Name = "tabProperties"; + this.tabProperties.Size = new System.Drawing.Size(975, 558); + this.tabProperties.Text = "tabInfo"; // // grpContainerDescriptor // @@ -94,9 +96,9 @@ private void InitializeComponent() // panelDescriptorCriteria // this.panelDescriptorCriteria.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelDescriptorCriteria.Location = new System.Drawing.Point(2, 21); + this.panelDescriptorCriteria.Location = new System.Drawing.Point(2, 23); this.panelDescriptorCriteria.Name = "panelDescriptorCriteria"; - this.panelDescriptorCriteria.Size = new System.Drawing.Size(962, 467); + this.panelDescriptorCriteria.Size = new System.Drawing.Size(962, 465); this.panelDescriptorCriteria.TabIndex = 0; // // lblDescription @@ -143,8 +145,15 @@ private void InitializeComponent() // tabParameters // this.tabParameters.Name = "tabParameters"; - this.tabParameters.Size = new System.Drawing.Size(971, 555); - this.tabParameters.Text = "Parameters"; + this.tabParameters.Size = new System.Drawing.Size(975, 558); + this.tabParameters.Text = "tabParameters"; + // + // tabTags + // + this.tabTags.Name = "tabTags"; + this.tabTags.Padding = new System.Windows.Forms.Padding(10); + this.tabTags.Size = new System.Drawing.Size(975, 558); + this.tabTags.Text = "tabTags"; // // barManager // @@ -153,13 +162,13 @@ private void InitializeComponent() this.barManager.DockControls.Add(this.barDockControlLeft); this.barManager.DockControls.Add(this.barDockControlRight); this.barManager.Form = this; - this.barManager.MaxItemId = 0; // // barDockControlTop // this.barDockControlTop.CausesValidation = false; this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top; this.barDockControlTop.Location = new System.Drawing.Point(0, 0); + this.barDockControlTop.Manager = this.barManager; this.barDockControlTop.Size = new System.Drawing.Size(977, 0); // // barDockControlBottom @@ -167,6 +176,7 @@ private void InitializeComponent() this.barDockControlBottom.CausesValidation = false; this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom; this.barDockControlBottom.Location = new System.Drawing.Point(0, 583); + this.barDockControlBottom.Manager = this.barManager; this.barDockControlBottom.Size = new System.Drawing.Size(977, 0); // // barDockControlLeft @@ -174,6 +184,7 @@ private void InitializeComponent() this.barDockControlLeft.CausesValidation = false; this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left; this.barDockControlLeft.Location = new System.Drawing.Point(0, 0); + this.barDockControlLeft.Manager = this.barManager; this.barDockControlLeft.Size = new System.Drawing.Size(0, 583); // // barDockControlRight @@ -181,13 +192,14 @@ private void InitializeComponent() this.barDockControlRight.CausesValidation = false; this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right; this.barDockControlRight.Location = new System.Drawing.Point(977, 0); + this.barDockControlRight.Manager = this.barManager; this.barDockControlRight.Size = new System.Drawing.Size(0, 583); // // EditEventGroupView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.xtraTabControl1); + this.Controls.Add(this.tabControl); this.Controls.Add(this.barDockControlLeft); this.Controls.Add(this.barDockControlRight); this.Controls.Add(this.barDockControlBottom); @@ -195,10 +207,10 @@ private void InitializeComponent() this.Name = "EditEventGroupView"; this.Size = new System.Drawing.Size(977, 583); ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit(); - this.xtraTabControl1.ResumeLayout(false); - this.tabInfo.ResumeLayout(false); - this.tabInfo.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tabControl)).EndInit(); + this.tabControl.ResumeLayout(false); + this.tabProperties.ResumeLayout(false); + this.tabProperties.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.grpContainerDescriptor)).EndInit(); this.grpContainerDescriptor.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.panelDescriptorCriteria)).EndInit(); @@ -206,13 +218,14 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.btName.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.barManager)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - private DevExpress.XtraTab.XtraTabControl xtraTabControl1; - private DevExpress.XtraTab.XtraTabPage tabInfo; + private DevExpress.XtraTab.XtraTabControl tabControl; + private DevExpress.XtraTab.XtraTabPage tabProperties; private DevExpress.XtraTab.XtraTabPage tabParameters; private DevExpress.XtraEditors.LabelControl lblDescription; private DevExpress.XtraEditors.MemoExEdit htmlEditor; @@ -225,5 +238,6 @@ private void InitializeComponent() private DevExpress.XtraBars.BarDockControl barDockControlLeft; private DevExpress.XtraBars.BarDockControl barDockControlRight; private DevExpress.XtraEditors.PanelControl panelDescriptorCriteria; + private DevExpress.XtraTab.XtraTabPage tabTags; } } diff --git a/src/MoBi.UI/Views/EditEventGroupView.cs b/src/MoBi.UI/Views/EditEventGroupView.cs index 12069d024..844e0c977 100644 --- a/src/MoBi.UI/Views/EditEventGroupView.cs +++ b/src/MoBi.UI/Views/EditEventGroupView.cs @@ -1,6 +1,5 @@ using OSPSuite.DataBinding; using OSPSuite.DataBinding.DevExpress; -using OSPSuite.UI; using OSPSuite.Utility.Extensions; using DevExpress.XtraBars; using DevExpress.XtraEditors.Controls; @@ -8,9 +7,8 @@ using MoBi.Presentation.DTO; using MoBi.Presentation.Presenter; using MoBi.Presentation.Views; -using OSPSuite.Presentation; +using OSPSuite.Assets; using OSPSuite.UI.Controls; -using OSPSuite.Presentation.Extensions; using OSPSuite.Presentation.Views; using OSPSuite.UI.Extensions; using OSPSuite.UI.Services; @@ -42,6 +40,11 @@ public override void InitializeResources() { base.InitializeResources(); tabParameters.Text = AppConstants.Captions.Parameters; + tabParameters.Image = ApplicationIcons.Parameter; + tabProperties.Text = AppConstants.Captions.Properties; + tabProperties.Image = ApplicationIcons.Properties; + tabTags.Text = AppConstants.Captions.Tags; + tabTags.Image = ApplicationIcons.Tag; } public void Activate() @@ -80,8 +83,8 @@ private void initNameEdit(EventGroupBuilderDTO eventGroupBuilder) public bool EnableDescriptors { - get { return grpContainerDescriptor.Enabled; } - set { grpContainerDescriptor.Enabled = value; } + get => grpContainerDescriptor.Enabled; + set => grpContainerDescriptor.Enabled = value; } public void ShowParameters() @@ -94,19 +97,20 @@ public void AddDescriptorConditionListView(IView view) panelDescriptorCriteria.FillWith(view); } - public override bool HasError + public void AddTagsView(IView view) { - get { return base.HasError || _screenBinder.HasError; } + tabTags.FillWith(view); } - public BarManager PopupBarManager - { - get { return barManager; } - } + public override bool HasError => base.HasError || _screenBinder.HasError; + + public BarManager PopupBarManager => barManager; private void btName_ButtonClick(object sender, ButtonPressedEventArgs e) { _presenter.RenameSubject(); } + + } } \ No newline at end of file diff --git a/src/MoBi.UI/Views/EditEventGroupView.resx b/src/MoBi.UI/Views/EditEventGroupView.resx index eee6beda7..ee051ab53 100644 --- a/src/MoBi.UI/Views/EditEventGroupView.resx +++ b/src/MoBi.UI/Views/EditEventGroupView.resx @@ -121,6 +121,6 @@ 17, 17 - 17, 56 + 140, 17 \ No newline at end of file diff --git a/src/MoBi.UI/Views/EditParameterListView.cs b/src/MoBi.UI/Views/EditParameterListView.cs index 51b48f79c..4f5081e71 100644 --- a/src/MoBi.UI/Views/EditParameterListView.cs +++ b/src/MoBi.UI/Views/EditParameterListView.cs @@ -19,7 +19,6 @@ using OSPSuite.Presentation.DTO; using OSPSuite.UI.Binders; using OSPSuite.UI.Controls; -using OSPSuite.UI.Extensions; using OSPSuite.UI.RepositoryItems; using OSPSuite.UI.Services; using OSPSuite.UI.Views; @@ -36,7 +35,7 @@ public partial class EditParameterListView : BaseUserControl, IEditParameterList private readonly UxComboBoxUnit _unitControl; private IEditParameterListPresenter _presenter; private RepositoryItemButtonEdit _isFixedParameterEditRepository; - private readonly RepositoryItemTextEdit _stantdardParameterEditRepository = new RepositoryItemTextEdit(); + private readonly RepositoryItemTextEdit _standardParameterEditRepository = new RepositoryItemTextEdit(); private readonly UxRepositoryItemCheckEdit _favoriteRepository; private readonly IToolTipCreator _toolTipCreator; private readonly ValueOriginBinder _valueOriginBinder; @@ -180,7 +179,7 @@ private RepositoryItem repositoryForValue(ParameterDTO parameter) if (_presenter.IsFixedValue(parameter)) return _isFixedParameterEditRepository; - return _stantdardParameterEditRepository; + return _standardParameterEditRepository; } private void configureRepository(BaseEdit activeEditor, ParameterDTO parameter) diff --git a/tests/MoBi.Tests/Presentation/EditContainerPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditContainerPresenterSpecs.cs index 5786416cf..07f2e0b6d 100644 --- a/tests/MoBi.Tests/Presentation/EditContainerPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditContainerPresenterSpecs.cs @@ -12,12 +12,12 @@ namespace MoBi.Presentation { public abstract class concern_for_EditContainerPresenterSpecs : ContextSpecification { - private IEntityTask _enityTask; protected IEditContainerView _view; private IContainerToContainerDTOMapper _containerMapper; private IEditTaskForContainer _editTasks; protected IEditParametersInContainerPresenter _parametersInContainerPresenter; private IMoBiContext _context; + private ITagsPresenter _tagsPresenter; protected override void Context() { @@ -26,12 +26,12 @@ protected override void Context() _editTasks = A.Fake(); _parametersInContainerPresenter = A.Fake(); _context = A.Fake(); - _enityTask = A.Fake(); - sut = new EditContainerPresenter(_view, _containerMapper, _editTasks, _parametersInContainerPresenter, _context, _enityTask); + _tagsPresenter = A.Fake(); + sut = new EditContainerPresenter(_view, _containerMapper, _editTasks, _parametersInContainerPresenter, _context, _tagsPresenter); } } - internal class When_told_a_containerpresenter_to_select_parameters : concern_for_EditContainerPresenterSpecs + internal class When_told_a_container_presenter_to_select_parameters : concern_for_EditContainerPresenterSpecs { private IParameter _parameter; @@ -47,7 +47,7 @@ protected override void Because() } [Observation] - public void should_tell_view_to_show_parmaeters() + public void should_tell_view_to_show_parameters() { A.CallTo(() => _view.ShowParameters()); } diff --git a/tests/MoBi.Tests/Presentation/EditParameterPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditParameterPresenterSpecs.cs index e0c92dca9..48c70eecc 100644 --- a/tests/MoBi.Tests/Presentation/EditParameterPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditParameterPresenterSpecs.cs @@ -25,7 +25,6 @@ public abstract class concern_for_EditParameterPresenter : ContextSpecification< protected IEditFormulaPresenter _editFormulaPresenter; protected IParameterToParameterDTOMapper _parameterMapper; protected IEditFormulaPresenter _editRHSPresenter; - private IEntityTask _entityTaks; protected IInteractionTaskContext _interactionTasksContext; protected IGroupRepository _groupRepository; private IEditTaskFor _editTasks; @@ -33,6 +32,7 @@ public abstract class concern_for_EditParameterPresenter : ContextSpecification< protected IInteractionTasksForParameter _parameterTask; protected ICommandCollector _commandCollector; protected IEditValueOriginPresenter _editValueOriginPresenter; + protected ITagsPresenter _tagsPresenter; protected override void Context() { @@ -40,15 +40,22 @@ protected override void Context() _editFormulaPresenter = A.Fake(); _parameterMapper = A.Fake(); _editRHSPresenter = A.Fake(); - _entityTaks = A.Fake(); _interactionTasksContext = A.Fake(); _groupRepository = A.Fake(); _editTasks = A.Fake>(); _favoriteTask = A.Fake(); _parameterTask = A.Fake(); _editValueOriginPresenter= A.Fake(); - sut = new EditParameterPresenter(_view, _editFormulaPresenter, _parameterMapper, _editRHSPresenter, _interactionTasksContext, - _entityTaks, _groupRepository, _editTasks, _parameterTask, new ContextSpecificReferencesRetriever(), _favoriteTask,_editValueOriginPresenter) + _tagsPresenter= A.Fake(); + sut = new EditParameterPresenter( + _view, + _editFormulaPresenter, + _parameterMapper, + _editRHSPresenter, + _interactionTasksContext, + _groupRepository, + _editTasks, + _parameterTask, new ContextSpecificReferencesRetriever(), _favoriteTask,_editValueOriginPresenter, _tagsPresenter) { BuildingBlock = A.Fake() };