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
- 继承
注解
为事件创建处理程序, 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 LinqDataSourceContextEventArgs 。The 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() |
获取当前实例的 Type。Gets 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) |