Skip to content

Commit

Permalink
more adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Cerqueira committed Sep 23, 2023
1 parent 80eb313 commit aacffbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion Src/Controls/Table/ItemTableRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ public ItemTableRow()
public string UniqueId => _uniqueId;
public T Value { get; set; }
public bool Disabled { get; set; }
public bool IsSeparator { get; set; }
}
}
10 changes: 5 additions & 5 deletions Src/Controls/Table/TableControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public override string InitControl(CancellationToken cancellationToken)
int index;
do
{
index = _options.Items.FindIndex(x => !x.IsSeparator && _options.EqualItems(x.Value, item));
index = _options.Items.FindIndex(x => _options.EqualItems(x.Value, item));
if (index >= 0)
{
_options.Items.RemoveAt(index);
Expand All @@ -116,7 +116,7 @@ public override string InitControl(CancellationToken cancellationToken)
foreach (var item in _options.DisableItems)
{
List<ItemTableRow<T>> founds;
founds = _options.Items.FindAll(x => !x.IsSeparator && _options.EqualItems(x.Value, item));
founds = _options.Items.FindAll(x =>_options.EqualItems(x.Value, item));
if (founds.Any())
{
foreach (var itemfound in founds)
Expand Down Expand Up @@ -152,11 +152,11 @@ public override string InitControl(CancellationToken cancellationToken)
{
if (_options.IsOrderDescending)
{
_options.Items = _options.Items.Where(x => !x.IsSeparator).OrderByDescending(x => _options.OrderBy.Invoke(x.Value)).ToList();
_options.Items = _options.Items.OrderByDescending(x => _options.OrderBy.Invoke(x.Value)).ToList();
}
else
{
_options.Items = _options.Items.Where(x => !x.IsSeparator).OrderBy(x => _options.OrderBy.Invoke(x.Value)).ToList();
_options.Items = _options.Items.OrderBy(x => _options.OrderBy.Invoke(x.Value)).ToList();
}
}
var skip = 0;
Expand Down Expand Up @@ -484,7 +484,7 @@ public IControlTable<T> AddFormatType<T1>(Func<object,string> funcfomatType)

public IControlTable<T> AddItem(T value, bool disable = false)
{
_options.Items.Add(new ItemTableRow<T>() { Value = value, Disabled = disable, IsSeparator = false });
_options.Items.Add(new ItemTableRow<T>() { Value = value, Disabled = disable});
return this;
}

Expand Down

0 comments on commit aacffbf

Please sign in to comment.