Bamboo.Prevalence.Collections.List.Map C# (CSharp) Метод

Map() публичный Метод

Maps every object in this list to an equivalent (Equals(item) returns true) in the list passed as argument. The entire mapping operation is accomplished in the context of a writer lock.
public Map ( IEnumerable list ) : void
list IEnumerable
Результат void
		public void Map(IEnumerable list)
		{
			if (null == list)
			{
				throw new ArgumentNullException("list");
			}

			AcquireWriterLock();
			try
			{
				for (int i=0; i<_list.Count; ++i)
				{
					object existing = _list[i];
					if (null != existing)
					{
						foreach (object item in list)
						{
							if (existing.Equals(item))
							{
								_list[i] = item;
								break;
							}
						}
					}
				}
			}
			finally
			{
				ReleaseWriterLock();
			}
		}

Same methods

List::Map ( Mapping mapping ) : void