All pastes #795752 Raw Edit

Miscellany

public text v1 · immutable
#795752 ·published 2007-11-24 12:35 UTC
rendered paste body
	public interface IItemsCollectionReadOnly<TKey, TValue>
	{
		TValue this[TKey Key] { get; }
		bool ContainsKey( TKey Key );
		bool TryGetValue( TKey key, out TValue Value );
		bool Contains( KeyValuePair<TKey, TValue> Pair );
		void CopyTo( KeyValuePair<TKey, TValue>[] Array, int ArrayIndex );
		int Count { get; }
		bool IsReadOnly { get; }
		ICollection<TKey> Keys { get; }
		ICollection<TValue> Values { get; }
		IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator();
		Item FindItemByPath( string Path );
	}
	public interface IItemsCollection<TKey, TValue> : IItemsCollectionReadOnly<TKey, TValue>
	{
		new TValue this[TKey Key] { get; set; }
		void Add( TKey Key, TValue Value );
		void Add( KeyValuePair<TKey, TValue> Pair );
		bool Remove( TKey Key );
		bool Remove( KeyValuePair<TKey, TValue> Pair );
		void Clear();
	}
	/// <summary>
	/// Collection of items
	/// </summary>
	public class ItemsCollection : IItemsCollection<Item, Dictionary<string, List<Version>>>, IXmlSerializable
	{
		private Dictionary<Item, Dictionary<string, List<Version>>> items = new Dictionary<Item, Dictionary<string, List<Version>>>();