Suggérer une traduction
 
Suggestions d'autres utilisateurs :

progress indicator
Aucune autre suggestion.
Cliquez pour évaluer et commenter
MSDN
MSDN Library
Développement .NET
.NET Framework 4
Espaces de noms System.Web
System.Web.UI.WebControls
Réduire tout/Développer tout Réduire tout
Affichage du contenu :  côte à côteAffichage du contenu : côte à côte
.NET Framework Class Library
LinqDataSourceDisposeEventArgs Class

Provides data for the ContextDisposing event.

System..::.Object
  System..::.EventArgs
    System.ComponentModel..::.CancelEventArgs
      System.Web.UI.WebControls..::.LinqDataSourceDisposeEventArgs

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
Visual Basic
Public Class LinqDataSourceDisposeEventArgs _
    Inherits CancelEventArgs
C#
public class LinqDataSourceDisposeEventArgs : CancelEventArgs
Visual C++
public ref class LinqDataSourceDisposeEventArgs : public CancelEventArgs
F#
type LinqDataSourceDisposeEventArgs =  
    class
        inherit CancelEventArgs
    end

The LinqDataSourceDisposeEventArgs type exposes the following members.

  NameDescription
Public methodLinqDataSourceDisposeEventArgsInitializes a new instance of the LinqDataSourceDisposeEventArgs class.
Top
  NameDescription
Public propertyCancelGets or sets a value indicating whether the event should be canceled. (Inherited from CancelEventArgs.)
Public propertyObjectInstanceGets the data context object to dispose.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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. The LinqDataSourceDisposeEventArgs object contains the data context object that is used when you are selecting, updating, inserting, or deleting data. The ContextDisposing event is raised during the Unload event before the LinqDataSource control disposes the context object.

The data context object is the type specified in the ContextTypeName property or the type set to the ObjectInstance of the LinqDataSourceContextEventArgs class.

When the LinqDataSource control interacts with a database, the ContextTypeName property is set to the DataContext object that represents the database. When the LinqDataSource control interacts with an in-memory data collection, the ContextTypeName property is set to the object that contains the data collection.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Bibliothèque de classes .NET Framework
LinqDataSourceDisposeEventArgs, classe

Fournit des données pour l'événement ContextDisposing.

System..::.Object
  System..::.EventArgs
    System.ComponentModel..::.CancelEventArgs
      System.Web.UI.WebControls..::.LinqDataSourceDisposeEventArgs

Espace de noms :  System.Web.UI.WebControls
Assembly :  System.Web.Extensions (dans System.Web.Extensions.dll)
Visual Basic
Public Class LinqDataSourceDisposeEventArgs _
    Inherits CancelEventArgs
C#
public class LinqDataSourceDisposeEventArgs : CancelEventArgs
VisualC++
public ref class LinqDataSourceDisposeEventArgs : public CancelEventArgs
F#
type LinqDataSourceDisposeEventArgs =  
    class
        inherit CancelEventArgs
    end

Le type LinqDataSourceDisposeEventArgs expose les membres suivants.

  NomDescription
Méthode publiqueLinqDataSourceDisposeEventArgsInitialise une nouvelle instance de la classe LinqDataSourceDisposeEventArgs.
Début
  NomDescription
Propriété publiqueCancelObtient ou définit une valeur indiquant si l'événement doit être annulé. (Hérité de CancelEventArgs.)
Propriété publiqueObjectInstanceObtient l'objet de contexte de données à supprimer.
Début
  NomDescription
Méthode publiqueEquals(Object)Détermine si l'Object spécifié est égal à l'Object en cours. (Hérité de Object.)
Méthode protégéeFinalizeAutorise un objet à tenter de libérer des ressources et d'exécuter d'autres opérations de netto***ge avant qu'il ne soit récupéré par l'opération garbage collection. (Hérité de Object.)
Méthode publiqueGetHashCodeSert de fonction de hachage pour un type particulier. (Hérité de Object.)
Méthode publiqueGetTypeObtient le Type de l'instance actuelle. (Hérité de Object.)
Méthode protégéeMemberwiseCloneCrée une copie superficielle de l'objet Object actif. (Hérité de Object.)
Méthode publiqueToStringRetourne une chaîne qui représente l'objet actuel. (Hérité de Object.)
Début

Vous créez un gestionnaire pour que l'événement ContextDisposing exécute un nettoyage spécifique à l'objet de contexte de données avant que l'objet soit détruit. L'objet LinqDataSourceDisposeEventArgs contient l'objet de contexte de données utilisé lorsque vous sélectionnez, mettez à jour, insérez ou supprimez des données. L'événement ContextDisposing est déclenché pendant l'événement Unload, avant que le contrôle LinqDataSource ne supprime l'objet de contexte.

L'objet de contexte de données est le type spécifié dans la propriété ContextTypeName ou le type avec la valeur ObjectInstance de la classe LinqDataSourceContextEventArgs.

Lorsque le contrôle LinqDataSource interagit avec une base de données, la propriété ContextTypeName a pour valeur l'objet DataContext qui représente la base de données. Lorsque le contrôle LinqDataSource interagit avec une collection de données en mémoire, la propriété ContextTypeName a pour valeur l'objet qui contient la collection de données.

.NET Framework

Pris en charge dans : 4, 3.5

Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2

Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Tous les membres static (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.
Contenu de la communauté   Qu'est-ce que le Contenu de la communauté ?
Ajouter du contenu RSS  Annotations
Processing
© 2012 Microsoft. Tous droits réservés. Conditions d'utilisation | Marques | Confidentialité
Page view tracker