From d38bf750367c6d6cdda3a6a3efbdf3552aa85358 Mon Sep 17 00:00:00 2001 From: Roy Date: Sun, 13 Nov 2022 03:46:12 +0200 Subject: FSE Stats Module. Extended job run structure. CSV export. --- .../Components/SelectedObjectCollection.cs | 45 +++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs') diff --git a/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs b/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs index 8aa087ed3..a174dc070 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs @@ -1,14 +1,32 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.SharedUI.Components; + +public static class ISelectedObjectCollectionExt +{ + public static IList GetItems(this ISelectedObjectCollection source) + { + return source.Cast().ToList(); + } +} namespace Tango.SharedUI.Components { - public class SelectedObjectCollection : ObservableCollection> + public interface ISelectedObjectCollection : IEnumerable, INotifyCollectionChanged + { + event EventHandler SelectionChanged; + ObservableCollection Source { get; set; } + ObservableCollection SynchedSource { get; set; } + } + + public class SelectedObjectCollection : ObservableCollection>, ISelectedObjectCollection { private Func _compareFunc; @@ -16,6 +34,11 @@ namespace Tango.SharedUI.Components public ObservableCollection Source { get; set; } public ObservableCollection SynchedSource { get; set; } + ObservableCollection ISelectedObjectCollection.Source { get; set; } + ObservableCollection ISelectedObjectCollection.SynchedSource { get; set; } + + public bool IsReadOnly { get; } + public SelectedObjectCollection(ObservableCollection source, ObservableCollection synchedSource, Func compareFunc) { _compareFunc = compareFunc; @@ -77,5 +100,25 @@ namespace Tango.SharedUI.Components SelectionChanged?.Invoke(this, new EventArgs()); } + + public void Add(SelectedObject item) + { + base.Add((SelectedObject)item); + } + + public bool Contains(SelectedObject item) + { + return base.Contains((SelectedObject)item); + } + + public void CopyTo(SelectedObject[] array, int arrayIndex) + { + base.CopyTo(array.Cast>().ToArray(), arrayIndex); + } + + public bool Remove(SelectedObject item) + { + return base.Remove((SelectedObject)item); + } } } -- cgit v1.3.1