Skip to content

Commit

Permalink
Less code in FXB! Using more from Rappen.XTB.Helpers repo
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Apr 20, 2024
1 parent a40adfb commit 3c65edb
Show file tree
Hide file tree
Showing 21 changed files with 50 additions and 427 deletions.
258 changes: 0 additions & 258 deletions FXBEditorUtils/ControlUtils.cs

This file was deleted.

3 changes: 0 additions & 3 deletions FXBEditorUtils/FXBEditorUtils.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
<Import_RootNamespace>FXBEditorUtils</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)ControlUtils.cs" />
<Compile Include="$(MSBuildThisFileDirectory)FindTextHandler.cs" />
<Compile Include="$(MSBuildThisFileDirectory)IComboBoxItem.cs" />
<Compile Include="$(MSBuildThisFileDirectory)IDefinitionSavable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ListViewItemComparer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Prompt.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SaveEventArgs.cs" />
Expand Down
7 changes: 0 additions & 7 deletions FXBEditorUtils/IComboBoxItem.cs

This file was deleted.

11 changes: 0 additions & 11 deletions FXBEditorUtils/IDefinitionSavable.cs

This file was deleted.

2 changes: 2 additions & 0 deletions FetchXmlBuilder/Controls/FetchXmlElementControlBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Microsoft.Xrm.Sdk.Metadata;
using Rappen.XRM.Helpers.FetchXML;
using Rappen.XRM.Helpers.Interfaces;
using Rappen.XTB.FetchXmlBuilder.DockControls;
using Rappen.XTB.Helpers;
using Rappen.XTB.XmlEditorUtils;
using System;
using System.Collections.Generic;
Expand Down
10 changes: 5 additions & 5 deletions FetchXmlBuilder/Controls/attributeControl.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Microsoft.Xrm.Sdk.Metadata;
using Rappen.XRM.Helpers.FetchXML;
using Rappen.XTB.FetchXmlBuilder.Builder;
using Rappen.XTB.FetchXmlBuilder.ControlsClasses;
using Rappen.XTB.FetchXmlBuilder.DockControls;
using Rappen.XTB.FetchXmlBuilder.Views;
using Rappen.XTB.Helpers.ControlItems;
using System;
using System.Linq;
using System.Windows.Forms;
Expand Down Expand Up @@ -42,7 +42,7 @@ protected override void PopulateControls()
cmbAggregate.SelectedIndex = -1;
chkGroupBy.Checked = false;
}
cmbAttribute.Items.AddRange(attributes?.Select(a => new AttributeItem(a, fxb.settings.ShowAttributeTypes)).ToArray());
cmbAttribute.Items.AddRange(attributes?.Select(a => new AttributeMetadataItem(a, fxb.settings.UseFriendlyNames, fxb.settings.ShowAttributeTypes)).ToArray());
UpdateUIFromCell();
}

Expand All @@ -56,12 +56,12 @@ protected override ControlValidationResult ValidateControl(Control control)
}
if (fxb.entities != null)
{
var attributename = (cmbAttribute.SelectedItem is AttributeItem item && item.Metadata != null) ? item.Metadata.LogicalName : cmbAttribute.Text;
var attributename = (cmbAttribute.SelectedItem is AttributeMetadataItem item && item.Metadata != null) ? item.Metadata.LogicalName : cmbAttribute.Text;
if (!allattributes.Any(a => a.LogicalName == attributename))
{
return new ControlValidationResult(ControlValidationLevel.Warning, "Attribute", ControlValidationMessage.NotInMetadata);
}
if (!cmbAttribute.Items.OfType<AttributeItem>().Any(a => a.ToString() == cmbAttribute.Text))
if (!cmbAttribute.Items.OfType<AttributeMetadataItem>().Any(a => a.ToString() == cmbAttribute.Text))
{
return new ControlValidationResult(ControlValidationLevel.Info, "Attribute", ControlValidationMessage.NotShowingNow);
}
Expand Down Expand Up @@ -183,7 +183,7 @@ private void UpdateCellUI()

public override MetadataBase Metadata()
{
if (cmbAttribute.SelectedItem is AttributeItem item)
if (cmbAttribute.SelectedItem is AttributeMetadataItem item)
{
return item.Metadata;
}
Expand Down
Loading

0 comments on commit 3c65edb

Please sign in to comment.