Exemplo n.º 1
0
        public void MarkUnrecognized()
        {
            var unrecognizedPacket = new UnrecognizedPacket(Body);

            _payloadPackets.Clear();
            _payloadPackets.Add(unrecognizedPacket);
        }
Exemplo n.º 2
0
        protected void SetSamplePackets()
        {
            var samplePackets = new PacketBase[] {
                new BNetPacket(null, false, new RPCHeader(-1, -1, -1), null),
                // new PegPacket(null, false, -1, null),
            };

            _packets.Clear();
            _packets.AddRange(samplePackets);
        }
Exemplo n.º 3
0
        public void Clear_EmptyCollection_CollectionIsStillEmptyAndNoCollectionChangedRaised()
        {
            var collectionChangedEventArgsList = new List <NotifyCollectionChangedEventArgs>();

            var collection = new ExtendedObservableCollection <int>();

            collection.CollectionChanged += (_, args) => collectionChangedEventArgsList.Add(args);

            collection.Clear();

            Assert.Empty(collection);
            Assert.Empty(collectionChangedEventArgsList);
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            var collection = new ExtendedObservableCollection <string>();

            collection.CollectionChanged += Collection_CollectionChanged;

            collection.Add("item1");
            collection.AddRange(new string[] { "item2", "item3", "item4" });
            collection[0] = "item1 mk2";
            collection.Move(0, 3);
            collection.Remove("item3");
            collection.Clear();
        }
Exemplo n.º 5
0
        public void Clear_CollectionWithItems_CollectionIsEmptyAndCollectionChangedRaised()
        {
            var collectionChangedEventArgsList = new List <NotifyCollectionChangedEventArgs>();

            var collection = new ExtendedObservableCollection <int> {
                123, 456
            };

            collection.CollectionChanged += (_, args) => collectionChangedEventArgsList.Add(args);

            Assert.Equal(2, collection.Count);

            collection.Clear();

            Assert.Empty(collection);

            Assert.Single(collectionChangedEventArgsList);
            Assert.Equal(NotifyCollectionChangedAction.Reset, collectionChangedEventArgsList[0].Action);
        }