⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pagelocationcollection.cs

📁 基于.Net环境下c#实现的国人自己的Blog平台,基于.Text的核心技术,但做了汉化以及改写了一部分的核心代码,值得研究学习
💻 CS
📖 第 1 页 / 共 4 页
字号:
			}

		}

		#endregion

		#region Class ReadOnlyList

		[Serializable]
		private sealed class ReadOnlyList : PageLocationCollection
		{

			private PageLocationCollection _collection;

			internal ReadOnlyList(PageLocationCollection collection) : base(Tag.Default)
			{
				this._collection = collection;
			}

			#region Public Properties

			public override int Capacity
			{
				get { return this._collection.Capacity; }
				set { throw new NotSupportedException("Read-only collections cannot be modified."); }
			}

			public override int Count
			{
				get { return this._collection.Count; }
			}

			public override bool IsFixedSize
			{
				get { return true; }
			}

			public override bool IsReadOnly
			{
				get { return true; }
			}

			public override bool IsSynchronized
			{
				get { return this._collection.IsSynchronized; }
			}

			public override PageLocation this[int index]
			{
				get { return this._collection[index]; }
				set { throw new NotSupportedException("Read-only collections cannot be modified."); }
			}

			public override object SyncRoot
			{
				get { return this._collection.SyncRoot; }
			}

			#endregion

			#region Public Methods

			public override int Add(PageLocation value)
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override void AddRange(PageLocationCollection collection)
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override void AddRange(PageLocation[] array)
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override int BinarySearch(PageLocation value)
			{
				return this._collection.BinarySearch(value);
			}

			public override void Clear()
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override object Clone()
			{
				return new ReadOnlyList((PageLocationCollection) this._collection.Clone());
			}

			public override bool Contains(PageLocation value)
			{
				return this._collection.Contains(value);
			}

			public override void CopyTo(PageLocation[] array)
			{
				this._collection.CopyTo(array);
			}

			public override void CopyTo(PageLocation[] array, int arrayIndex)
			{
				this._collection.CopyTo(array, arrayIndex);
			}

			public override IPageLocationEnumerator GetEnumerator()
			{
				return this._collection.GetEnumerator();
			}

			public override int IndexOf(PageLocation value)
			{
				return this._collection.IndexOf(value);
			}

			public override void Insert(int index, PageLocation value)
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override void Remove(PageLocation value)
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override void RemoveAt(int index)
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override void RemoveRange(int index, int count)
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override void Sort()
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			public override PageLocation[] ToArray()
			{
				return this._collection.ToArray();
			}

			public override void TrimToSize()
			{
				throw new NotSupportedException("Read-only collections cannot be modified.");
			}

			#endregion
		}

		#endregion

		#region Class SyncList

		[Serializable]
		private sealed class SyncList : PageLocationCollection
		{

			private PageLocationCollection _collection;
			private object _root;

			internal SyncList(PageLocationCollection collection) : base(Tag.Default)
			{

				this._root = collection.SyncRoot;
				this._collection = collection;
			}

			#region Public Properties

			public override int Capacity
			{
				get
				{
					lock (this._root)
						return this._collection.Capacity;
				}
				set
				{
					lock (this._root)
						this._collection.Capacity = value;
				}
			}

			public override int Count
			{
				get
				{
					lock (this._root)
						return this._collection.Count;
				}
			}

			public override bool IsFixedSize
			{
				get { return this._collection.IsFixedSize; }
			}

			public override bool IsReadOnly
			{
				get { return this._collection.IsReadOnly; }
			}

			public override bool IsSynchronized
			{
				get { return true; }
			}

			public override PageLocation this[int index]
			{
				get
				{
					lock (this._root)
						return this._collection[index];
				}
				set
				{
					lock (this._root)
						this._collection[index] = value;
				}
			}

			public override object SyncRoot
			{
				get { return this._root; }
			}

			#endregion

			#region Public Methods

			public override int Add(PageLocation value)
			{
				lock (this._root)
					return this._collection.Add(value);
			}

			public override void AddRange(PageLocationCollection collection)
			{
				lock (this._root)
					this._collection.AddRange(collection);
			}

			public override void AddRange(PageLocation[] array)
			{
				lock (this._root)
					this._collection.AddRange(array);
			}

			public override int BinarySearch(PageLocation value)
			{
				lock (this._root)
					return this._collection.BinarySearch(value);
			}

			public override void Clear()
			{
				lock (this._root)
					this._collection.Clear();
			}

			public override object Clone()
			{
				lock (this._root)
					return new SyncList((PageLocationCollection) this._collection.Clone());
			}

			public override bool Contains(PageLocation value)
			{
				lock (this._root)
					return this._collection.Contains(value);
			}

			public override void CopyTo(PageLocation[] array)
			{
				lock (this._root)
					this._collection.CopyTo(array);
			}

			public override void CopyTo(PageLocation[] array, int arrayIndex)
			{
				lock (this._root)
					this._collection.CopyTo(array, arrayIndex);
			}

			public override IPageLocationEnumerator GetEnumerator()
			{
				lock (this._root)
					return this._collection.GetEnumerator();
			}

			public override int IndexOf(PageLocation value)
			{
				lock (this._root)
					return this._collection.IndexOf(value);
			}

			public override void Insert(int index, PageLocation value)
			{
				lock (this._root)
					this._collection.Insert(index, value);
			}

			public override void Remove(PageLocation value)
			{
				lock (this._root)
					this._collection.Remove(value);
			}

			public override void RemoveAt(int index)
			{
				lock (this._root)
					this._collection.RemoveAt(index);
			}

			public override void RemoveRange(int index, int count)
			{
				lock (this._root)
					this._collection.RemoveRange(index, count);
			}

			public override void Sort()
			{
				lock (this._root)
					this._collection.Sort();
			}

			public override PageLocation[] ToArray()
			{
				lock (this._root)
					return this._collection.ToArray();
			}

			public override void TrimToSize()
			{
				lock (this._root)
					this._collection.TrimToSize();
			}

			#endregion
		}

		#endregion
	}

	#endregion
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -