Bamboo.Prevalence.Collections.List.GetRange C# (CSharp) Method

GetRange() public method

public GetRange ( int index, int count ) : object[]
index int
count int
return object[]
		public object[] GetRange(int index, int count)
		{
			if (index < 0)
			{
				throw new ArgumentOutOfRangeException("index", index, "Index can't be negative!");
			}
			
			if (count < 0)
			{
				throw new ArgumentOutOfRangeException("count", count, "Count can't be negative!");
			}
			
			object[] range = null;
			AcquireReaderLock();
			try
			{				
				if (index > _list.Count - 1)
				{
					range = new object[0];
				}
				else
				{
					int avail = _list.Count - index;
					count = Math.Min(count, avail);
					range = new object[count];
					for (int i=0; i<count; ++i)
					{
						range[i] = _list[index + i];
					}
				}
			}
			finally
			{
				ReleaseReaderLock();
			}
			return range;
		}