DataSet.ShouldSerializeTables Metoda

Definicja

Pobiera wartość wskazującą, czy Tables właściwość powinna być utrwalone.

protected:
 virtual bool ShouldSerializeTables();
protected virtual bool ShouldSerializeTables ();
abstract member ShouldSerializeTables : unit -> bool
override this.ShouldSerializeTables : unit -> bool
Protected Overridable Function ShouldSerializeTables () As Boolean

Zwraca

true jeśli wartość właściwości została zmieniona z wartości domyślnej; w przeciwnym razie , false.

Przykłady

W poniższym przykładzie pokazano klasę pochodzącą z DataSet klasy. Metoda jest wywoływana ShouldSerializeTables z funkcji w klasie pochodnej.

public  class DerivedDataSet:System.Data.DataSet
{
    public void ResetDataSetRelations()
    {
        // Check the ShouldPersistTable method
        // before invoking Reset.
        if(!this.ShouldSerializeTables())
        {
            this.Reset();
        }
    }
}
Public Class DerivedDataSet
    Inherits System.Data.DataSet
    
    Public Sub ResetDataSetRelations()
        ' Check the ShouldPersistTable method 
        ' before invoking Reset.
        If Not Me.ShouldSerializeTables() Then
            Me.Reset()
        End If
    End Sub
End Class

Uwagi

Ta metoda jest zwykle używana tylko wtedy, gdy tworzysz projektanta dla elementu DataSetlub tworzysz własną kontrolkę zawierającą DataSetelement .

Dotyczy

Zobacz też