aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-08-26 20:09:38 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-08-26 20:09:38 +0300
commit7d7281f91edfb2d0e7d0e92bd282403f0426f94d (patch)
tree4672bd653c0abdb6612032a819f670993a31a17a /Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs
parentf98cac2d6e331eaf62167d63524134d53db921ef (diff)
downloadTango-7d7281f91edfb2d0e7d0e92bd282403f0426f94d.tar.gz
Tango-7d7281f91edfb2d0e7d0e92bd282403f0426f94d.zip
Added new colorized static text widget to tech board.
Added option to go back to job/jobs from running job view. Fixed issue with bug reporting. Fixed other bugs.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs')
-rw-r--r--Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs b/Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs
new file mode 100644
index 000000000..f0a13b3c9
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+
+namespace Tango.Core
+{
+ public class SynchronizedObservableCollection<T> : ObservableCollection<T>
+ {
+ public SynchronizedObservableCollection() : base()
+ {
+ this.EnableCrossThreadOperations();
+ }
+
+ public SynchronizedObservableCollection(IEnumerable<T> collection) : base(collection)
+ {
+
+ }
+
+ protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
+ {
+ if (ObservableEntityCollectionSettings._dispatcher != null)
+ {
+ ObservableEntityCollectionSettings._dispatcher.BeginInvoke(new Action(() =>
+ {
+ base.OnCollectionChanged(e);
+ }));
+ }
+ else
+ {
+ base.OnCollectionChanged(e);
+ }
+ }
+ }
+}