Last-Modified: Mon, 13 Jul 2026 01:47:57 GMT Expires: Thu, 10 Jul 2036 01:47:57 GMT CSharpScriptItemView.xaml « ProjectItemsViews « Tango.Scripting.IDE « Tango.Scripting « TEMP « Visual_Studio « Software - Tango - Twine softwares
aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/ProjectItemsViews/CSharpScriptItemView.xaml
blob: 682956205b29cd95bbf6dc3e3a1f4d9d3b111a12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.MachineStudio.Logging
{
    public class ControlledObservableCollection<T> : ObservableCollection<T>
    {
        public bool DisableNotification { get; set; }

        public ControlledObservableCollection() : base()
        {

        }

        public ControlledObservableCollection(IEnumerable<T> collection) : base(collection)
        {

        }

        protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
        {
            if (!DisableNotification)
            {
                base.OnCollectionChanged(e);
            }
        }

        public void AddRange(IEnumerable<T> collection)
        {
            foreach (var item in collection)
            {
                Add(item);
            }
        }

        public void InsertRange(int index, IEnumerable<T> collection)
        {
            foreach (var item in collection)
            {
                Insert(index, item);
            }
        }
    }
}