diff --git a/Src/Controls/Table/ItemTableRow.cs b/Src/Controls/Table/ItemTableRow.cs index bb08744..8f3b8c4 100644 --- a/Src/Controls/Table/ItemTableRow.cs +++ b/Src/Controls/Table/ItemTableRow.cs @@ -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; } } } diff --git a/Src/Controls/Table/TableControl.cs b/Src/Controls/Table/TableControl.cs index 71dc0aa..0fd27a2 100644 --- a/Src/Controls/Table/TableControl.cs +++ b/Src/Controls/Table/TableControl.cs @@ -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); @@ -116,7 +116,7 @@ public override string InitControl(CancellationToken cancellationToken) foreach (var item in _options.DisableItems) { List> 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) @@ -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; @@ -484,7 +484,7 @@ public IControlTable AddFormatType(Func funcfomatType) public IControlTable AddItem(T value, bool disable = false) { - _options.Items.Add(new ItemTableRow() { Value = value, Disabled = disable, IsSeparator = false }); + _options.Items.Add(new ItemTableRow() { Value = value, Disabled = disable}); return this; }