TransformerInfo 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定由網頁組件連線使用,擴充 WebPartTransformer 類別的自訂類別。
public ref class TransformerInfo sealed : System::Configuration::ConfigurationElement
public sealed class TransformerInfo : System.Configuration.ConfigurationElement
type TransformerInfo = class
inherit ConfigurationElement
Public NotInheritable Class TransformerInfo
Inherits ConfigurationElement
- 繼承
範例
下列組態檔摘要說明如何以宣告方式指定類別數個 TransformerInfo 屬性的值。
<system.web>
<webParts>
<transformers>
<add name="RowToFieldTransformer"
type="System.Web.UI.WebControls.WebParts.RowToFieldTransformer" />
<add name="RowToFilterTransformer"
type="System.Web.UI.WebControls.WebParts.RowToFilterTransformer" />
<add name="RowToParametersTransformer"
type="System.Web.UI.WebControls.WebParts.RowToParametersTransformer" />
</transformers>
</webParts>
</system.web>
下列程式碼範例示範如何使用 TransformerInfo 類別。 此程式代碼範例是提供給 類別之較大範例的 WebPartsSection 一部分。
// 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 元件之間轉譯數據。
建構函式
TransformerInfo(String, String) |
使用指定的名稱和型別參考,初始化 TransformerInfo 類別的新執行個體。 |