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

屬性值

如果 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

備註

屬性 DirtySessionStateModule 用來判斷實作中的 ISessionStateItemCollection 值是否已修改。

在實作 介面時 ISessionStateItemCollection ,您應該將 屬性初始化 Dirtyfalse ,並在 、 RemoveAtClear 方法的 Remove 實作中將 屬性 true 設定 Dirty 為 。

適用於

另請參閱