aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ControlledObservableCollection.cs
blob: e16393e83c98473a40718bb3644847e22548391a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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);
            }
        }
    }
}
class="p">, "IWNvbS50d2luZS50YW5nby5wbXIudGhyZWFkbG9hZGluZ2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.ThreadLoading.StopThreadLoadingResponse), global::Tango.PMR.ThreadLoading.StopThreadLoadingResponse.Parser, null, null, null, null) })); } #endregion } #region Messages public sealed partial class StopThreadLoadingResponse : pb::IMessage<StopThreadLoadingResponse> { private static readonly pb::MessageParser<StopThreadLoadingResponse> _parser = new pb::MessageParser<StopThreadLoadingResponse>(() => new StopThreadLoadingResponse()); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<StopThreadLoadingResponse> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Tango.PMR.ThreadLoading.StopThreadLoadingResponseReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StopThreadLoadingResponse() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StopThreadLoadingResponse(StopThreadLoadingResponse other) : this() { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StopThreadLoadingResponse Clone() { return new StopThreadLoadingResponse(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as StopThreadLoadingResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(StopThreadLoadingResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } return true; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(StopThreadLoadingResponse other) { if (other == null) { return; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: input.SkipLastField(); break; } } } } #endregion } #endregion Designer generated code