<commit_before>﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace Mapogee
{
    public class LayerCollection : ICollection<ILayer>
    {
        private readonly List<ILayer> _layers = new List<ILayer>();

        public event EventHandler<EventArgs<ILayer>> LayerRemoved;
        public event EventHandler<EventArgs<ILayer>> LayerAdded;
        
        public void Add(ILayer layer)
        {
            _layers.Add(layer);
            OnLayerAdded(layer);
        }

        public void Clear()
        {
            throw new NotImplementedException();
        }

        public bool Contains(ILayer item)
        {
            throw new NotImplementedException();
        }

        public void CopyTo(ILayer[] array, int arrayIndex)
        {
            throw new NotImplementedException();
        }

        bool ICollection<ILayer>.Remove(ILayer item)
        {
            throw new NotImplementedException();
        }

        public int Count { get; }
        public bool IsReadOnly { get; }

        public void Remove(ILayer layer)
        {
            _layers.Remove(layer);
            OnLayerRemoved(layer);
        }

        private void OnLayerRemoved(ILayer layer)
        {
            var handler = LayerRemoved;
            handler?.Invoke(this, new EventArgs<ILayer>(layer));
        }

        private void OnLayerAdded(ILayer layer)
        {
            var handler = LayerAdded;
            handler?.Invoke(this, new EventArgs<ILayer>(layer));
        }

        public IEnumerator<ILayer> GetEnumerator()
        {
            throw new NotImplementedException();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}<commit_msg>...and implementing<commit_after>﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace Mapogee
{
    public class LayerCollection : ICollection<ILayer>
    {
        private readonly IList<ILayer> _layers = new List<ILayer>();

        public event EventHandler<EventArgs<ILayer>> LayerRemoved;
        public event EventHandler<EventArgs<ILayer>> LayerAdded;
        
        public void Add(ILayer layer)
        {
            _layers.Add(layer);
            OnLayerAdded(layer);
        }

        public void Clear()
        {
            _layers.Clear();
        }

        public bool Contains(ILayer item)
        {
            return _layers.Contains(item);
        }

        public void CopyTo(ILayer[] array, int arrayIndex)
        {
            _layers.CopyTo(array, arrayIndex);
        }

        bool ICollection<ILayer>.Remove(ILayer item)
        {
            return _layers.Remove(item);
        }

        public int Count => _layers.Count;

        public bool IsReadOnly => _layers.IsReadOnly;

        public void Remove(ILayer layer)
        {
            _layers.Remove(layer);
            OnLayerRemoved(layer);
        }

        private void OnLayerRemoved(ILayer layer)
        {
            var handler = LayerRemoved;
            handler?.Invoke(this, new EventArgs<ILayer>(layer));
        }

        private void OnLayerAdded(ILayer layer)
        {
            var handler = LayerAdded;
            handler?.Invoke(this, new EventArgs<ILayer>(layer));
        }

        public IEnumerator<ILayer> GetEnumerator()
        {
            return _layers.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}
{'fraction_non_alphanumeric': 0.08598183881952327, 'fraction_numerical': 0.0, 'mean_word_length': 1.8087649402390438, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1982649', 'n_tokens_mistral': 931, 'n_tokens_neox': 910, 'n_words': 203}