Beispiel #1
0
        // ToString()  -
        // Routine Description:
        //     Generates a string representation of the headers, that is ready to be sent except for it being in string format:
        //     the format looks like:
        //
        //     Header-Name: Header-Value\r\n
        //     Header-Name2: Header-Value2\r\n
        //     ...
        //     Header-NameN: Header-ValueN\r\n
        //     \r\n
        //
        //     Uses the string builder class to Append the elements together.
        // Arguments:
        //     None.
        // Return Value:
        //     string
        public override string ToString()
        {
            if (Count == 0)
            {
                return("\r\n");
            }

            var sb = new StringBuilder(ApproxAveHeaderLineSize * Count);

            foreach (string key in InnerCollection)
            {
                string val = InnerCollection.Get(key);
                sb.Append(key)
                .Append(": ")
                .Append(val)
                .Append("\r\n");
            }

            sb.Append("\r\n");
            if (GlobalLog.IsEnabled)
            {
                GlobalLog.Print("WebHeaderCollection::ToString: \r\n" + sb.ToString());
            }
            return(sb.ToString());
        }
        public void Add(string header)
        {
            if (string.IsNullOrEmpty(header))
            {
                throw new ArgumentNullException(nameof(header));
            }
            int colpos = header.IndexOf(':');

            // check for badly formed header passed in
            if (colpos < 0)
            {
                throw new ArgumentException(SR.net_WebHeaderMissingColon, nameof(header));
            }
            string name  = header.Substring(0, colpos);
            string value = header.Substring(colpos + 1);

            name = HttpValidationHelpers.CheckBadHeaderNameChars(name);
            ThrowOnRestrictedHeader(name);
            value = HttpValidationHelpers.CheckBadHeaderValueChars(value);
            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Info(this, $"Add({header}) calling InnerCollection.Add() key:[{name}], value:[{value}]");
            }
            if (_type == WebHeaderCollectionType.WebResponse)
            {
                if (value != null && value.Length > ushort.MaxValue)
                {
                    throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(CultureInfo.InvariantCulture, SR.net_headers_toolong, ushort.MaxValue));
                }
            }
            InvalidateCachedArrays();
            InnerCollection.Add(name, value);
        }
Beispiel #3
0
 private void EnsureInnerCollection()
 {
     if (this.innerCollection == null)
     {
         this.innerCollection = new InnerCollection(this.owner);
     }
 }
        public override void Add(string name, string value)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (name.Length == 0)
            {
                throw new ArgumentException(SR.Format(SR.net_emptyStringCall, nameof(name)), nameof(name));
            }

            name = HttpValidationHelpers.CheckBadHeaderNameChars(name);
            ThrowOnRestrictedHeader(name);
            value = HttpValidationHelpers.CheckBadHeaderValueChars(value);
            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Info(this, $"calling InnerCollection.Add() key:[{name}], value:[{value}]");
            }
            if (_type == WebHeaderCollectionType.WebResponse)
            {
                if (value != null && value.Length > ushort.MaxValue)
                {
                    throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(CultureInfo.InvariantCulture, SR.net_headers_toolong, ushort.MaxValue));
                }
            }
            InvalidateCachedArrays();
            InnerCollection.Add(name, value);
        }
Beispiel #5
0
            public void Save(ContinuousSecurity entity)
            {
                entity.CheckExchange();

                if (!Contains(entity))
                {
                    InnerCollection.Add(entity);
                }

                using (var batch = _registry.Storage.BeginBatch())
                {
                    _jumps.RemoveWhere(j => j.Id.ContinuousSecurity == entity.Id);
                    _jumps.AddRange(entity.ExpirationJumps.Select(p => new ContinuousSecurityJump
                    {
                        Id = new ContinuousSecurityId
                        {
                            ContinuousSecurity = entity.Id,
                            JumpSecurity       = p.Key,
                        },
                        JumpDate = p.Value,
                    }));

                    batch.Commit();
                }
            }
Beispiel #6
0
 public void AddRange(IEnumerable <T> collection)
 {
     foreach (var item in collection)
     {
         InnerCollection.Add(item);
     }
 }
        // ToString()  -
        // Routine Description:
        //     Generates a string representation of the headers, that is ready to be sent except for it being in string format:
        //     the format looks like:
        //
        //     Header-Name: Header-Value\r\n
        //     Header-Name2: Header-Value2\r\n
        //     ...
        //     Header-NameN: Header-ValueN\r\n
        //     \r\n
        //
        //     Uses the string builder class to Append the elements together.
        // Arguments:
        //     None.
        // Return Value:
        //     string
        public override string ToString()
        {
            if (Count == 0)
            {
                return("\r\n");
            }

            var sb = new StringBuilder(ApproxAveHeaderLineSize * Count);

            foreach (string key in InnerCollection)
            {
                string val = InnerCollection.Get(key);
                sb.Append(key)
                .Append(": ")
                .Append(val)
                .Append("\r\n");
            }

            sb.Append("\r\n");
            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Info(this, $"ToString: {sb}");
            }
            return(sb.ToString());
        }
Beispiel #8
0
 public void Renew(int count)
 {
     InnerCollection.Clear();
     for (int i = 0; i < count; i++)
     {
         InnerCollection.Add(new BankToken());
     }
 }
Beispiel #9
0
        // GetValues
        // Routine Description:
        //     This method takes a header name and returns a string array representing
        //     the individual values for that headers. For example, if the headers
        //     contained the line Accept: text/plain, text/html then
        //     GetValues("Accept") would return an array of two strings: "text/plain"
        //     and "text/html".
        // Arguments:
        //     header      - Name of the header.
        // Return Value:
        //     string[] - array of parsed string objects

        /// <devdoc>
        ///    <para>
        ///       Gets an array of header values stored in a
        ///       header.
        ///    </para>
        /// </devdoc>
        public override string[] GetValues(string header)
        {
            // First get the information about the header and the values for
            // the header.
            HeaderInfo Info = s_headerInfos[header];

            string[] Values = InnerCollection.GetValues(header);
            // If we have no information about the header or it doesn't allow
            // multiple values, just return the values.
            if (Info == null || Values == null || !Info.AllowMultiValues)
            {
                return(Values);
            }
            // Here we have a multi value header. We need to go through
            // each entry in the multi values array, and if an entry itself
            // has multiple values we'll need to combine those in.
            //
            // We do some optimazation here, where we try not to copy the
            // values unless there really is one that have multiple values.
            string[]  TempValues;
            ArrayList ValueList = null;
            int       i;

            for (i = 0; i < Values.Length; i++)
            {
                // Parse this value header.
                TempValues = Info.Parser(Values[i]);
                // If we don't have an array list yet, see if this
                // value has multiple values.
                if (ValueList == null)
                {
                    // See if it has multiple values.
                    if (TempValues.Length > 1)
                    {
                        // It does, so we need to create an array list that
                        // represents the Values, then trim out this one and
                        // the ones after it that haven't been parsed yet.
                        ValueList = new ArrayList(Values);
                        ValueList.RemoveRange(i, Values.Length - i);
                        ValueList.AddRange(TempValues);
                    }
                }
                else
                {
                    // We already have an ArrayList, so just add the values.
                    ValueList.AddRange(TempValues);
                }
            }
            // See if we have an ArrayList. If we don't, just return the values.
            // Otherwise convert the ArrayList to a string array and return that.
            if (ValueList != null)
            {
                string[] ReturnArray = new string[ValueList.Count];
                ValueList.CopyTo(ReturnArray);
                return(ReturnArray);
            }
            return(Values);
        }
        // GetValues
        // Routine Description:
        //     This method takes a header name and returns a string array representing
        //     the individual values for that headers. For example, if the headers
        //     contained the line Accept: text/plain, text/html then
        //     GetValues("Accept") would return an array of two strings: "text/plain"
        //     and "text/html".
        // Arguments:
        //     header      - Name of the header.
        // Return Value:
        //     string[] - array of parsed string objects
        public override string[] GetValues(string header)
        {
            // First get the information about the header and the values for
            // the header.
            HeaderInfo info = HeaderInfo[header];

            string[] values = InnerCollection.GetValues(header);
            // If we have no information about the header or it doesn't allow
            // multiple values, just return the values.
            if (info == null || values == null || !info.AllowMultiValues)
            {
                return(values);
            }
            // Here we have a multi value header. We need to go through
            // each entry in the multi values array, and if an entry itself
            // has multiple values we'll need to combine those in.
            //
            // We do some optimazation here, where we try not to copy the
            // values unless there really is one that have multiple values.
            string[]      tempValues;
            List <string> valueList = null;

            for (int i = 0; i < values.Length; i++)
            {
                // Parse this value header.
                tempValues = info.Parser(values[i]);
                // If we don't have an array list yet, see if this
                // value has multiple values.
                if (valueList == null)
                {
                    // If it's not empty, replace valueList.
                    // Because for invalid WebRequest headers, we will return empty
                    // valueList instead of the default NameValueCollection.GetValues().
                    if (tempValues != null)
                    {
                        // It does, so we need to create an array list that
                        // represents the Values, then trim out this one and
                        // the ones after it that haven't been parsed yet.
                        valueList = new List <string>(values);
                        valueList.RemoveRange(i, values.Length - i);
                        valueList.AddRange(tempValues);
                    }
                }
                else
                {
                    // We already have an List, so just add the values.
                    valueList.AddRange(tempValues);
                }
            }
            // See if we have an List. If we don't, just return the values.
            // Otherwise convert the List to a string array and return that.
            if (valueList != null)
            {
                return(valueList.ToArray());
            }
            return(values);
        }
        protected virtual bool TryAdd(T item)
        {
            if (IsDebugEnabled)
            {
                log.Debug("요소를 추가합니다... item=[{0}]", item);
            }

            return(InnerCollection.TryAdd(item));
        }
 /// <summary>
 /// Clear the contents of the collection and replace it with new contents.  Does not trigger Add or Remove events.
 /// </summary>
 /// <param name="newContents">The new contents of the collection.</param>
 public void Overwrite(IEnumerable <T> newContents)
 {
     lock (InnerCollection)
     {
         ClearImpl();
         InnerCollection.AddRange(newContents);
         InnerCollection.ForEach(i => i.Modified += ContentsModified);
     }
 }
        /// <summary>
        /// 요소를 내부 버퍼에서 꺼내기를 시도합니다.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        protected virtual bool TryTake(out T item)
        {
            if (IsDebugEnabled)
            {
                log.Debug("요소를 꺼내려고 합니다...");
            }

            return(InnerCollection.TryTake(out item));
        }
Beispiel #14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        public void Add(object value)
        {
            var nvString = value as string;

            if (nvString != null)
            {
                var nv = nvString.Split(',');
                InnerCollection.Add(nv[0], nv[1]);
            }
        }
Beispiel #15
0
        public override bool Remove(SprTag item)
        {
            InnerCollection.Remove(item);
            var curItem = Table.Rows.Find(item.Id);

            Table.Rows.Remove(curItem);

            Update();
            return(true);
        }
 protected WebHeaderCollection(SerializationInfo serializationInfo, StreamingContext streamingContext)
 {
     int count = serializationInfo.GetInt32("Count");
     for (int i = 0; i < count; i++)
     {
         string headerName = serializationInfo.GetString(i.ToString(NumberFormatInfo.InvariantInfo));
         string headerValue = serializationInfo.GetString((i + count).ToString(NumberFormatInfo.InvariantInfo));
         if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"calling InnerCollection.Add() key:[{headerName}], value:[{headerValue}]");
         InnerCollection.Add(headerName, headerValue);
     }
 }
        /// <summary>
        /// Copy the contents of this collection into another collection.
        /// </summary>
        /// <param name="target">The collection whose contents should be overwritten.</param>
        public void CopyTo(NoteCollection target)
        {
            if (target is null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            lock (InnerCollection)
            {
                lock (target)
                {
                    Dictionary <string, Note> thisContents = InnerCollection.ToDictionary(n => n.Id, n => n);
                    Dictionary <string, bool> tagged       = new Dictionary <string, bool>();
                    for (int i = 0; i < target.Count; ++i)
                    {
                        if (!thisContents.ContainsKey(target[i].Id))
                        {
                            target.RemoveAt(i--);
                        }
                        else
                        {
                            thisContents[target[i].Id].CopyTo(target[i]);
                            tagged.Add(target[i].Id, true);
                        }
                    }
                    foreach (KeyValuePair <string, Note> item in thisContents)
                    {
                        if (!tagged.ContainsKey(item.Key))
                        {
                            target.Add(item.Value);
                        }
                    }
                    for (int i = 0; i < Count; ++i)
                    {
                        if (this[i].Id != target[i].Id)
                        {
                            int targetIdx = -1;
                            for (int j = i + 1; j < target.Count; ++j)
                            {
                                if (this[i].Id == target[j].Id)
                                {
                                    targetIdx = j;
                                    break;
                                }
                            }
                            Note tmp = target[targetIdx];
                            target.RemoveAt(targetIdx);
                            target.Insert(i, tmp);
                        }
                    }
                }
            }
        }
 /// <summary>
 /// Add an item to the collection.
 /// </summary>
 /// <param name="item">The item to add.</param>
 public virtual void Add(T item)
 {
     lock (InnerCollection)
     {
         InnerCollection.Add(item);
         OnAdd(item, InnerCollection.Count - 1);
     }
     if (item != null)
     {
         item.Modified += ContentsModified;
     }
 }
 /// <summary>
 /// Insert an item into the collection at a specific index.
 /// </summary>
 /// <param name="idx">The index to insert the item at.</param>
 /// <param name="item">The item to be inserted.</param>
 public virtual void Insert(int idx, T item)
 {
     lock (InnerCollection)
     {
         InnerCollection.Insert(idx, item);
         OnAdd(item, idx);
     }
     if (item != null)
     {
         item.Modified += ContentsModified;
     }
 }
Beispiel #20
0
 /// <summary>
 /// Sort the collection using the given <see cref="IComparer{LocationDisplayModel}"/>.
 /// </summary>
 /// <param name="locationDisplayModelComparer">The comparer to use when carrying out the sort.</param>
 public void Sort(IComparer <LocationDisplayModel> locationDisplayModelComparer)
 {
     lock (InnerCollection)
     {
         InnerCollection.Sort(locationDisplayModelComparer);
         foreach (string id in InnerCollection.Select(l => l.LocationId).Distinct())
         {
             SetDisplaySeparatorPropertiesOfGroup(id);
         }
         OnSort();
     }
 }
Beispiel #21
0
#pragma warning disable CS8765 // Nullability of parameter 'name' doesn't match overridden member
        public override void Set(string name, string?value)
#pragma warning restore CS8765
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            name  = HttpValidationHelpers.CheckBadHeaderNameChars(name);
            value = HttpValidationHelpers.CheckBadHeaderValueChars(value);
            InvalidateCachedArrays();
            InnerCollection.Set(name, value);
        }
Beispiel #22
0
        /// <summary>
        /// Add a <see cref="TrainSegmentModel"/> to a sorted collection, maintaining the sort order.
        /// </summary>
        /// <param name="item">The <see cref="TrainSegmentModel"/> to add.</param>
        /// <param name="comparer">The <see cref="TrainSegmentModelComparer"/> to use to determine the sort order.</param>
        /// <remarks>
        /// This method assumes that the collection is already sorted in the order that the passed comparer would recognise.  If not, you may get inconsistent results.  The
        /// comparer does not need to be provided if the collection is empty.
        /// </remarks>
        /// <exception cref="ArgumentNullException">Thrown if the <see cref="TrainSegmentModelComparer"/> parameter is null and the collection is not empty.</exception>
        public void AddSorted(TrainSegmentModel item, TrainSegmentModelComparer comparer)
        {
            lock (InnerCollection)
            {
                // Degenerate case with no sorting required.
                if (InnerCollection.Count == 0)
                {
                    Add(item);
                    return;
                }

                if (comparer == null)
                {
                    throw new ArgumentNullException(nameof(comparer));
                }

                List <TrainSegmentModel> newAdditions = new List <TrainSegmentModel>();
                InnerCollection.Add(item);
                bool eventRaised = false;
                for (var i = InnerCollection.Count - 1; i > 0; i--)
                {
                    var comparison = comparer.Compare(InnerCollection[i], InnerCollection[i - 1]);
                    if (comparison.Item2 != null)
                    {
                        newAdditions.Add(comparison.Item2);
                    }
                    if (comparison.Item1 < 0)
                    {
                        TrainSegmentModel swap = InnerCollection[i];
                        InnerCollection[i]     = InnerCollection[i - 1];
                        InnerCollection[i - 1] = swap;
                    }
                    else
                    {
                        OnAdd(item, i);
                        eventRaised = true;
                        break;
                    }
                }

                if (!eventRaised)
                {
                    OnAdd(item, 0);
                }

                foreach (var splitSegment in newAdditions)
                {
                    AddSorted(splitSegment, comparer);
                }
            }
        }
Beispiel #23
0
        internal void ReadItems(List <Exception> errors)
        {
            if (errors == null)
            {
                throw new ArgumentNullException(nameof(errors));
            }

            if (!File.Exists(_fileName))
            {
                return;
            }

            CultureInfo.InvariantCulture.DoInCulture(() =>
            {
                using (var stream = new FileStream(_fileName, FileMode.OpenOrCreate))
                {
                    var reader = new FastCsvReader(stream, Registry.Encoding);

                    while (reader.NextLine())
                    {
                        try
                        {
                            var item = Read(reader);
                            var key  = GetNormalizedKey(item);

                            lock (SyncRoot)
                            {
                                InnerCollection.Add(item);
                                AddCache(item);
                                _items.Add(key, item);
                            }
                        }
                        catch (Exception ex)
                        {
                            if (errors.Count < 10)
                            {
                                errors.Add(ex);
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                }
            });

            InnerCollection.ForEach(OnAdded);
        }
Beispiel #24
0
        // Our public METHOD set, most are inherited from NameValueCollection,
        // not all methods from NameValueCollection are listed, even though usable -
        //
        // This includes:
        // - Add(name, value)
        // - Add(header)
        // - this[name] {set, get}
        // - Remove(name), returns bool
        // - Remove(name), returns void
        // - Set(name, value)
        // - ToString()

        // Add -
        //  Routine Description:
        //      Adds headers with validation to see if they are "proper" headers.
        //      Will cause header to be concatenated to existing if already found.
        //      If the header is a special header, listed in RestrictedHeaders object,
        //      then this call will cause an exception indicating as such.
        //  Arguments:
        //      name - header-name to add
        //      value - header-value to add; if a header already exists, this value will be concatenated
        //  Return Value:
        //      None

        /// <devdoc>
        ///    <para>
        ///       Adds a new header with the indicated name and value.
        ///    </para>
        /// </devdoc>
        public override void Add(string name, string value)
        {
            name = CheckBadChars(name, false);
            ThrowOnRestrictedHeader(name);
            value = CheckBadChars(value, true);
            if (_type == WebHeaderCollectionType.HttpListenerResponse)
            {
                if (value != null && value.Length > ushort.MaxValue)
                {
                    throw new ArgumentOutOfRangeException("value", value, SR.Format(SR.net_headers_toolong, ushort.MaxValue));
                }
            }
            InvalidateCachedArrays();
            InnerCollection.Add(name, value);
        }
 protected void AddWithoutValidate(string name, string value)
 {
     name = HttpValidationHelpers.CheckBadHeaderNameChars(name);
     value = HttpValidationHelpers.CheckBadHeaderValueChars(value);
     if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"calling InnerCollection.Add() key:[{name}], value:[{value}]");
     if (_type == WebHeaderCollectionType.WebResponse)
     {
         if (value != null && value.Length > ushort.MaxValue)
         {
             throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(CultureInfo.InvariantCulture, SR.net_headers_toolong, ushort.MaxValue));
         }
     }
     InvalidateCachedArrays();
     InnerCollection.Add(name, value);
 }
Beispiel #26
0
        protected WebHeaderCollection(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            int count = serializationInfo.GetInt32("Count");

            for (int i = 0; i < count; i++)
            {
                string headerName  = serializationInfo.GetString(i.ToString(NumberFormatInfo.InvariantInfo));
                string headerValue = serializationInfo.GetString((i + count).ToString(NumberFormatInfo.InvariantInfo));
                if (GlobalLog.IsEnabled)
                {
                    GlobalLog.Print("WebHeaderCollection::.ctor(ISerializable) calling InnerCollection.Add() key:[" + headerName + "], value:[" + headerValue + "]");
                }
                InnerCollection.Add(headerName, headerValue);
            }
        }
        public virtual bool RetainAll(ICollection c)
        {
            int           idx    = 0;
            List <object> result = new List <object>(this.InnerCollection.Count);

            for (IEnumerator e = InnerCollection.GetEnumerator(); e.MoveNext();)
            {
                result[idx] = e.Current;
                idx++;
            }
            foreach (object obj2 in result)
            {
                if (!CollectionContains(c, obj2))
                {
                    this.Remove(obj2);
                }
            }
            return(this.Count != result.Count);
        }
Beispiel #28
0
        /// <summary>
        /// Add an element to a sorted collection, using the given <see cref="IComparer{LocationDisplayModel}" /> to determine the location to insert the element at.
        /// </summary>
        /// <param name="item">The element to be added to the collection.</param>
        /// <param name="comparer">The comparer to use when determining the location the element should be inserted at.</param>
        public int AddSorted(LocationDisplayModel item, LocationDisplayModelComparer comparer)
        {
            if (item is null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            lock (InnerCollection)
            {
                if (InnerCollection.Count == 0)
                {
                    Add(item);
                    return(Count - 1);
                }

                if (comparer == null)
                {
                    throw new ArgumentNullException(nameof(comparer));
                }

                InnerCollection.Add(item);
                for (var i = InnerCollection.Count - 1; i > 0; i--)
                {
                    var comparison = comparer.Compare(InnerCollection[i], InnerCollection[i - 1]);
                    if (comparison < 0)
                    {
                        LocationDisplayModel swap = InnerCollection[i];
                        InnerCollection[i]     = InnerCollection[i - 1];
                        InnerCollection[i - 1] = swap;
                    }
                    else
                    {
                        SetDisplaySeparatorPropertiesOfGroup(item.LocationId);
                        OnAdd(item, i);
                        return(i);
                    }
                }

                SetDisplaySeparatorPropertiesOfGroup(item.LocationId);
                OnAdd(item, 0);
                return(0);
            }
        }
Beispiel #29
0
 public override void Add(string name, string value)
 {
     name = HttpValidationHelpers.CheckBadHeaderNameChars(name);
     ThrowOnRestrictedHeader(name);
     value = HttpValidationHelpers.CheckBadHeaderValueChars(value);
     if (GlobalLog.IsEnabled)
     {
         GlobalLog.Print("WebHeaderCollection::Add() calling InnerCollection.Add() key:[" + name + "], value:[" + value + "]");
     }
     if (_type == WebHeaderCollectionType.WebResponse)
     {
         if (value != null && value.Length > ushort.MaxValue)
         {
             throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(CultureInfo.InvariantCulture, SR.net_headers_toolong, ushort.MaxValue));
         }
     }
     InvalidateCachedArrays();
     InnerCollection.Add(name, value);
 }
Beispiel #30
0
        /// <summary>
        /// Remove the item at a given index.
        /// </summary>
        /// <param name="idx">The index of the item to remove.</param>
        public override void RemoveAt(int idx)
        {
            if (idx < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(idx));
            }

            lock (InnerCollection)
            {
                if (idx >= InnerCollection.Count)
                {
                    throw new ArgumentOutOfRangeException(nameof(idx));
                }

                LocationDisplayModel item = InnerCollection[idx];
                InnerCollection.RemoveAt(idx);
                item.Modified -= ContentsModified;
                OnRemove(item, idx);
            }
        }