⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blacklist.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.Core
{
    using Imps.Common;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Runtime.CompilerServices;

    public class BlackList : ICollection<IicUri>, IEnumerable<IicUri>, IEnumerable
    {
        private ICollection<IicUri> _col = new List<IicUri>();
        private User _owner;
        private object _syncObj = new object();

        public event EventHandler Changed;

        public BlackList(User owner)
        {
            this._owner = owner;
        }

        public void Add(IicUri item)
        {
            lock (this.SyncRoot)
            {
                this._col.Add(item);
                FuncDispatcher.InvokeEventHandlerInUiThread(this, this.Changed, EventArgs.Empty);
            }
        }

        public void Clear()
        {
            this._col.Clear();
        }

        public bool Contains(IicUri item)
        {
            using (IEnumerator<IicUri> enumerator = this._col.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    if (enumerator.get_Current().EqualsSmartly(item))
                    {
                        return true;
                    }
                }
            }
            return false;
        }

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

        public IEnumerator<IicUri> GetEnumerator()
        {
            return this._col.GetEnumerator();
        }

        public bool Remove(IicUri item)
        {
            lock (this.SyncRoot)
            {
                if (this.Contains(item) && this._col.Remove(item))
                {
                    this._col.Remove(item);
                    FuncDispatcher.InvokeEventHandlerInUiThread(this, this.Changed, EventArgs.Empty);
                    return true;
                }
                return false;
            }
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }

        public int Count
        {
            get
            {
                return this._col.get_Count();
            }
        }

        public bool IsReadOnly
        {
            get
            {
                return this._col.get_IsReadOnly();
            }
        }

        public User Owner
        {
            get
            {
                return this._owner;
            }
        }

        public object SyncRoot
        {
            get
            {
                return this._syncObj;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -