WebPartsSection.Transformers 属性

定义

获取 TransformerInfo 对象的集合。Gets a collection of TransformerInfo objects.

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

属性值

属性

示例

下面的代码示例说明如何使用 Transformers 属性。The following code example shows how to use the Transformers property.

// 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类为受配置文件影响的 ASP.NET 应用程序扩展了用于 Web 部件连接的类。TransformerInfo objects specify custom classes that extend the WebPartTransformer class for use by Web Part connections for the ASP.NET applications affected by the configuration file. 这些转换器类作为连接的 Web 部件之间的桥梁, 在具有不兼容连接点的 Web 部件之间转换数据。These transformer classes act as bridges between connected Web Parts, translating data between Web Parts with incompatible connection points.

适用于

另请参阅