summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Infrastructure/ListFactory.cs
blob: 0e19bcbd628fea2ebac10d47ab4b73b688f80739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Collections.Generic;

namespace Marina.Infrastructure {
	public class ListFactory {
		public static IRichList< T > From< T >( IEnumerable< T > items ) {
			if ( items == null ) {
				return new RichList< T >( );
			}
			return new RichList< T >( items );
		}

		public static IEnumerable< T > For< T >( params T[] items ) {
			IRichList< T > list = new RichList< T >( );
			foreach ( T item in items ) {
				list.Add( item );
			}
			return list;
		}
	}
}