温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:LiveBlog v1.0测试版源码
当前文件:
LiveBlog/LiveBlog.Core/StateCollection.cs,打开代码结构图
LiveBlog/LiveBlog.Core/StateCollection.cs,打开代码结构图1namespace LiveBlog.Core 2
{ 3
/// <summary> 4
/// A generic collection with the ability to 5
/// check if it has been changed. 6
/// </summary> 7
[System.Serializable] 8
public class StateList<T> : System.Collections.Generic.List<T> 9
{ 10
11
Base overrides 89
90
private int _HasCode = 0; 91
92
/// <summary> 93
/// Gets if this object's data has been changed. 94
/// </summary> 95
/// <returns>A value indicating if this object's data has been changed.</returns> 96
public virtual bool IsChanged 97
{ 98
get 99
{ 100
return this.GetHashCode() != _HasCode; 101
} 102
} 103
104
/// <summary> 105
/// Marks the object as being clean, 106
/// which means not changed. 107
/// </summary> 108
public virtual void MarkOld() 109
{ 110
_HasCode = this.GetHashCode(); 111
base.TrimExcess(); 112
} 113
114
} 115
}





}