BlogEngine.Core/StateCollection.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace BlogEngine.Core
{
  /// <summary>
  /// A generic collection with the ability to 
  /// check if it has been changed.
  /// </summary>
  [System.Serializable]
  public class StateList<T> : System.Collections.Generic.List<T>
  {

    #region Base overrides

		///// <summary>
		///// Inserts an element into the collection at the specified index and marks it changed.
		///// </summary>
		//protected override void InsertItem(int index, T item)
		//{
		//  base.InsertItem(index, item);
		//  _IsChanged = true;
		//}

		///// <summary>
		///// Removes all the items in the collection and marks it changed.
		///// </summary>
		//protected override void ClearItems()
		//{
		//  base.ClearItems();
		//  _IsChanged = true;
		//}

		///// <summary>
		///// Removes the element at the specified index and marks the collection changed.
		///// </summary>
		//protected override void RemoveItem(int index)
		//{
		//  base.RemoveItem(index);
		//  _IsChanged = true;
		//}

		///// <summary>
		///// Replaces the element at the specified index and marks the collection changed.
		///// </summary>
		//protected override void SetItem(int index, T item)
		//{
		//  base.SetItem(index, item);
		//  _IsChanged = true;
		//}

		/// <summary>
		/// Serves as a hash function for a particular type. <see cref="M:System.Object.GetHashCode"></see> is suitable for use in hashing algorithms and data structures like a hash table.
		/// </summary>
		/// <returns>
		/// A hash code for the current <see cref="T:System.Object"></see>.
		/// </returns>
		public override int GetHashCode()
		{
			string hash = string.Empty;
			foreach (T item in this)
			{
				hash += item.GetHashCode().ToString();
后面还有 55 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。