using System; using System.Collections.Generic; using System.Collections; using ANX.Framework.NonXNA.Development; // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. // For details see: http://anxframework.codeplex.com/license namespace ANX.Framework.Net { [PercentageComplete(100)] [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Tested)] public class NetworkSessionProperties : IList, ICollection, IEnumerable, IEnumerable { private const int DataCount = 8; private readonly int?[] data = new int?[DataCount]; public int Count { get { return DataCount; } } bool ICollection.IsReadOnly { get { return false; } } public int? this[int index] { get { if (index < 0 || index >= DataCount) throw new ArgumentOutOfRangeException("index"); return data[index]; } set { if (index < 0 || index >= DataCount) throw new ArgumentOutOfRangeException("index"); data[index] = value; } } public int IndexOf(int? item) { return ((IList)data).IndexOf(item); } bool ICollection.Contains(int? item) { return ((IList)data).Contains(item); } void ICollection.CopyTo(int?[] array, int arrayIndex) { data.CopyTo(array, arrayIndex); } public IEnumerator GetEnumerator() { return ((IList)data).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return data.GetEnumerator(); } #region Unsupported Methods void IList.Insert(int index, int? item) { throw new NotSupportedException(); } void ICollection.Add(int? item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Remove(int? item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } #endregion } }