Ejemplo n.º 1
0
        /// <summary>
        /// Remove data from this list.
        /// All data in "this" list that is contained
        /// in parameter "data" is removed from this list.
        /// </summary>
        /// <param name='data'>Data that should be removed.</param>
        public void Remove(DataId32List <T> data)
        {
            Int32 index;

            if (this.IsNotEmpty() && data.IsNotEmpty())
            {
                for (index = Count - 1; index >= 0; index--)
                {
                    if (data.Exists(this[index]))
                    {
                        RemoveAt(index);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get this list converted to a DataId32List list.
        /// </summary>
        /// <returns>This list converted to a DataId32List list.</returns>
        public DataId32List <IDataId32> GetDataId32List()
        {
            DataId32List <IDataId32> dataId32List;

            dataId32List = null;
            if (this.IsNotEmpty())
            {
                dataId32List = new DataId32List <IDataId32>();
                // ReSharper disable once PossibleInvalidCastExceptionInForeachLoop
                foreach (IDataId32 dataId32 in this)
                {
                    dataId32List.Add(dataId32);
                }
            }

            return(dataId32List);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get the subset of two lists.
        /// All data in "this" list that is not contained
        /// in parameter "data" is removed from this list.
        /// </summary>
        /// <param name='data'>The data list to compare with.</param>
        public void Subset(DataId32List <T> data)
        {
            Int32 index;

            if (this.IsNotEmpty())
            {
                if (data.IsEmpty())
                {
                    Clear();
                }
                else
                {
                    for (index = Count - 1; index >= 0; index--)
                    {
                        if (!data.Exists(this[index]))
                        {
                            RemoveAt(index);
                        }
                    }
                }
            }
        }