LinqDataSourceDisposeEventArgs 類別

定義

提供 ContextDisposing 事件的資料。Provides data for the ContextDisposing event.

public ref class LinqDataSourceDisposeEventArgs : System::ComponentModel::CancelEventArgs
public class LinqDataSourceDisposeEventArgs : System.ComponentModel.CancelEventArgs
type LinqDataSourceDisposeEventArgs = class
    inherit CancelEventArgs
Public Class LinqDataSourceDisposeEventArgs
Inherits CancelEventArgs
繼承
LinqDataSourceDisposeEventArgs

備註

您可以建立事件的處理常式, ContextDisposing 以便在物件終結之前,執行資料內容物件特定的清除。You create a handler for the ContextDisposing event to perform clean-up that is specific to the data context object before the object is destroyed. LinqDataSourceDisposeEventArgs物件包含當您選取、更新、插入或刪除資料時所使用的資料內容物件。The LinqDataSourceDisposeEventArgs object contains the data context object that is used when you are selecting, updating, inserting, or deleting data. 事件 ContextDisposing 會在 Unload LinqDataSource 控制項處置內容物件之前引發。The ContextDisposing event is raised during the Unload event before the LinqDataSource control disposes the context object.

資料內容物件是在屬性中指定的型別, ContextTypeName 或是設定為類別之的型別 ObjectInstance LinqDataSourceContextEventArgsThe data context object is the type specified in the ContextTypeName property or the type set to the ObjectInstance of the LinqDataSourceContextEventArgs class.

LinqDataSource 控制項與資料庫互動時, ContextTypeName 屬性會設定為 DataContext 代表資料庫的物件。When the LinqDataSource control interacts with a database, the ContextTypeName property is set to the DataContext object that represents the database. LinqDataSource 控制項與記憶體中的資料集合互動時, ContextTypeName 屬性會設定為包含資料集合的物件。When the LinqDataSource control interacts with an in-memory data collection, the ContextTypeName property is set to the object that contains the data collection.

建構函式

LinqDataSourceDisposeEventArgs(Object)

初始化 LinqDataSourceDisposeEventArgs 類別的新執行個體。Initializes a new instance of the LinqDataSourceDisposeEventArgs class.

屬性

Cancel

取得或設定值,這個值表示是否應該取消事件。Gets or sets a value indicating whether the event should be canceled.

(繼承來源 CancelEventArgs)
ObjectInstance

取得要處置的資料內容物件。Gets the data context object to dispose.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於