ISessionStateItemCollection.Dirty 属性

定义

获取或设置一个值,该值指示是否已将集合标记为“已更改”。

public:
 property bool Dirty { bool get(); void set(bool value); };
public bool Dirty { get; set; }
member this.Dirty : bool with get, set
Public Property Dirty As Boolean

属性值

Boolean

如果 SessionStateItemCollection 内容已更改,则为 true;否则为 false

示例

下面的代码示例演示属性 Dirty 的实现。 有关接口的完整实现 ISessionStateItemCollection 的示例,请参阅为 ISessionStateItemCollection 接口概述提供的示例。

private bool pDirty = false;

public bool Dirty
{
  get { return pDirty; }
  set { pDirty = value; }
}
Private pDirty As Boolean = False

Public Property Dirty As Boolean Implements ISessionStateItemCollection.Dirty    
  Get
    Return pDirty
  End Get
  Set
    pDirty = value
  End Set
End Property

注解

Dirty 属性用于 SessionStateModule 确定是否修改了实现中的 ISessionStateItemCollection 值。

在实现ISessionStateItemCollection接口时,应将属性初始化Dirtyfalse ,并将属性true设置为 DirtyClear方法的实现RemoveRemoveAt

适用于

另请参阅