Bagikan melalui


WebPartsSection.Transformers Properti

Definisi

Mendapatkan kumpulan TransformerInfo objek.

public:
 property System::Web::Configuration::TransformerInfoCollection ^ Transformers { System::Web::Configuration::TransformerInfoCollection ^ get(); };
[System.Configuration.ConfigurationProperty("transformers")]
public System.Web.Configuration.TransformerInfoCollection Transformers { get; }
[<System.Configuration.ConfigurationProperty("transformers")>]
member this.Transformers : System.Web.Configuration.TransformerInfoCollection
Public ReadOnly Property Transformers As TransformerInfoCollection

Nilai Properti

Kumpulan TransformerInfoCollectionTransformerInfo objek.

Atribut

Contoh

Contoh kode berikut menunjukkan cara menggunakan Transformers properti .

// Add a Transfomer Info Object to the collection using a constructor.
webPartsSection.Transformers.Add(new TransformerInfo(
    "RowToFilterTransformer",
    "MyCustomTransformers.RowToFilterTransformer"));

// Show all TransformerInfo objects in the collection.
for (int ti = 0;
    ti < webPartsSection.Personalization.Providers.Count; ti++)
{
    Console.WriteLine("  #{0} Name={1} Type={2}", ti,
        webPartsSection.Transformers[ti].Name,
        webPartsSection.Transformers[ti].Type);
}

// Remove a TransformerInfo object by name.
webPartsSection.Transformers.Remove("RowToFilterTransformer");

// Remove a TransformerInfo object by index.
webPartsSection.Transformers.RemoveAt(0);

// Clear all TransformerInfo objects from the collection.
webPartsSection.Transformers.Clear();
' Add a Transfomer Info Object to the collection using a constructor.
webPartsSection.Transformers.Add(New TransformerInfo( _
  "RowToFilterTransformer", _
  "MyCustomTransformers.RowToFilterTransformer"))

' Show all TransformerInfo objects in the collection.
Dim ti As Integer
For ti = 0 To webPartsSection.Personalization.Providers.Count - 1
  Console.WriteLine("  #{0} Name={1} Type={2}", ti, _
    webPartsSection.Transformers(ti).Name, _
    webPartsSection.Transformers(ti).Type)
Next

' Remove a TransformerInfo object by name.
webPartsSection.Transformers.Remove("RowToFilterTransformer")

' Remove a TransformerInfo object by index.
webPartsSection.Transformers.RemoveAt(0)

' Clear all TransformerInfo objects from the collection.
webPartsSection.Transformers.Clear()

Keterangan

TransformerInfo objek menentukan kelas kustom yang memperluas WebPartTransformer kelas untuk digunakan oleh koneksi Bagian Web untuk aplikasi ASP.NET yang terpengaruh oleh file konfigurasi. Kelas transformator ini bertindak sebagai jembatan antara Bagian Web yang tersambung, menerjemahkan data antar Bagian Web dengan titik koneksi yang tidak kompatibel.

Berlaku untuk

Lihat juga