共用方式為


WebPartsSection.Transformers 屬性

定義

取得 TransformerInfo 物件的集合。

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

屬性值

TransformerInfoCollection 物件的 TransformerInfo 集合。

屬性

範例

下列程式碼範例示範如何使用 Transformers 屬性。

// 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()

備註

TransformerInfo 物件會指定自定義類別,以擴充 WebPartTransformer Web 元件連線所使用的類別,以供受組態檔影響的 ASP.NET 應用程式使用。 這些轉換程式類別可作為已連線網頁元件之間的網橋,在具有不相容連接點的 Web 元件之間轉譯數據。

適用於

另請參閱