aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2022-11-13 03:46:12 +0200
committerRoy <Roy.mail.net@gmail.com>2022-11-13 03:46:12 +0200
commitd38bf750367c6d6cdda3a6a3efbdf3552aa85358 (patch)
tree000818a2a1e49d1e3decc630a94cf183bbaf2128 /Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs
parent8431040bf909ba65d5ce242b5fd2cc91005ba679 (diff)
downloadTango-d38bf750367c6d6cdda3a6a3efbdf3552aa85358.tar.gz
Tango-d38bf750367c6d6cdda3a6a3efbdf3552aa85358.zip
FSE Stats Module.
Extended job run structure. CSV export.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Components/SelectedObjectCollection.cs45
1 files changed, 44 insertions, 1 deletions
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<SelectedObject> GetItems(this ISelectedObjectCollection source)
+ {
+ return source.Cast<SelectedObject>().ToList();
+ }
+}
namespace Tango.SharedUI.Components
{
- public class SelectedObjectCollection<T> : ObservableCollection<SelectedObject<T>>
+ public interface ISelectedObjectCollection : IEnumerable, INotifyCollectionChanged
+ {
+ event EventHandler SelectionChanged;
+ ObservableCollection<Object> Source { get; set; }
+ ObservableCollection<Object> SynchedSource { get; set; }
+ }
+
+ public class SelectedObjectCollection<T> : ObservableCollection<SelectedObject<T>>, ISelectedObjectCollection
{
private Func<T, T, bool> _compareFunc;
@@ -16,6 +34,11 @@ namespace Tango.SharedUI.Components
public ObservableCollection<T> Source { get; set; }
public ObservableCollection<T> SynchedSource { get; set; }
+ ObservableCollection<object> ISelectedObjectCollection.Source { get; set; }
+ ObservableCollection<object> ISelectedObjectCollection.SynchedSource { get; set; }
+
+ public bool IsReadOnly { get; }
+
public SelectedObjectCollection(ObservableCollection<T> source, ObservableCollection<T> synchedSource, Func<T, T, bool> compareFunc)
{
_compareFunc = compareFunc;
@@ -77,5 +100,25 @@ namespace Tango.SharedUI.Components
SelectionChanged?.Invoke(this, new EventArgs());
}
+
+ public void Add(SelectedObject item)
+ {
+ base.Add((SelectedObject<T>)item);
+ }
+
+ public bool Contains(SelectedObject item)
+ {
+ return base.Contains((SelectedObject<T>)item);
+ }
+
+ public void CopyTo(SelectedObject[] array, int arrayIndex)
+ {
+ base.CopyTo(array.Cast<SelectedObject<T>>().ToArray(), arrayIndex);
+ }
+
+ public bool Remove(SelectedObject item)
+ {
+ return base.Remove((SelectedObject<T>)item);
+ }
}
}