TransformerInfoCollection.Add(TransformerInfo) 方法
定义
将 TransformerInfo 对象添加到集合中。Adds a TransformerInfo object to the collection.
public:
void Add(System::Web::Configuration::TransformerInfo ^ transformerInfo);
public void Add (System.Web.Configuration.TransformerInfo transformerInfo);
member this.Add : System.Web.Configuration.TransformerInfo -> unit
Public Sub Add (transformerInfo As TransformerInfo)
参数
- transformerInfo
- TransformerInfo
要添加到集合的 TransformerInfo 对象。A TransformerInfo object to add to the collection.
例外
此集合中已存在要添加的 TransformerInfo 对象。The TransformerInfo object to add already exists in the collection.
- 或 --or- 该集合是只读的。The collection is read-only.
示例
下面的代码示例说明如何使用 Add 方法。The following code example shows how to use the Add method. 此代码示例是为类提供的更大示例的一部分 WebPartsSection 。This code example is part of a larger example provided for the WebPartsSection class.
// Add a Transfomer Info Object to the collection using a constructor.
webPartsSection.Transformers.Add(new TransformerInfo(
"RowToFilterTransformer",
"MyCustomTransformers.RowToFilterTransformer"));
' Add a Transfomer Info Object to the collection using a constructor.
webPartsSection.Transformers.Add(New TransformerInfo( _
"RowToFilterTransformer", _
"MyCustomTransformers.RowToFilterTransformer"))
注解
集合不能包含 TransformerInfo 具有相同 Name 属性值的对象。The collection must not already contain a TransformerInfo object with the same Name property value.