/**
         * 删除,不会触发任何事情
         *
         * @param object The object to remove.
         */
        public void remove(T obj)
        {
            int position = mObjects.IndexOf(obj);

            lock (mLock)
            {
                if (mObjects.Remove(obj))
                {
                    if (mObserver != null)
                    {
                        mObserver.OnItemRangeRemoved(position, 1);
                    }
                    if (mNotifyOnChange)
                    {
                        NotifyItemRemoved(headers.Count() + position);
                    }
                    log("remove NotifyItemRemoved " + (headers.Count() + position));
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 删除,不会触发任何事情
        /// </summary>
        /// <param name="obj"></param>
        public void Remove(T obj)
        {
            var position = objects.IndexOf(obj);

            lock (_lock)
            {
                if (!objects.Remove(obj))
                {
                    return;
                }

                _observer?.OnItemRangeRemoved(position, 1);

                if (_notifyOnChange)
                {
                    NotifyItemRemoved(headers.Count + position);
                }

                Log("remove NotifyItemRemoved " + (headers.Count + position));
            }
        }