本文整理汇总了VB.NET中System.Web.UI.WebControls.WebParts.WebPartTransformer类的典型用法代码示例。如果您正苦于以下问题:VB.NET WebPartTransformer类的具体用法?VB.NET WebPartTransformer怎么用?VB.NET WebPartTransformer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebPartTransformer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: GetStringValue
' An interface that the transformer provides to the consumer.
<AspNetHostingPermission(SecurityAction.Demand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Interface IString
Sub GetStringValue(ByVal callback As StringCallback)
End Interface
开发者ID:VB.NET开发者,项目名称:System.Web.UI.WebControls.WebParts,代码行数:8,代码来源:WebPartTransformer
示例2: RowToStringTransformer
' A transformer that transforms a row to a string.
<AspNetHostingPermission(SecurityAction.Demand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
<WebPartTransformer(GetType(IWebPartRow), GetType(IString))> _
Public Class RowToStringTransformer
Inherits WebPartTransformer
Implements IString
Private _provider As IWebPartRow
Private _callback As StringCallback
Private Sub GetRowData(ByVal rowData As Object)
Dim props As PropertyDescriptorCollection = _provider.Schema
If ((Not (props Is Nothing)) AndAlso (props.Count > 0) _
AndAlso (Not (rowData Is Nothing))) Then
Dim returnValue As String = String.Empty
For Each prop As PropertyDescriptor In props
If Not (prop Is props(0)) Then
returnValue += ", "
End If
returnValue += prop.DisplayName.ToString() + ": " + _
prop.GetValue(rowData).ToString()
Next
_callback(returnValue)
Else
_callback(Nothing)
End If
End Sub
Public Overrides Function Transform(ByVal providerData As Object) As Object
_provider = CType(providerData, IWebPartRow)
Return Me
End Function
Sub GetStringValue(ByVal callback As StringCallback) _
Implements IString.GetStringValue
If (callback Is Nothing) Then
Throw New ArgumentNullException("callback")
End If
If (Not (_provider Is Nothing)) Then
_callback = callback
_provider.GetRowData(New RowCallback(AddressOf GetRowData))
Else
callback(Nothing)
End If
End Sub
End Class
开发者ID:VB.NET开发者,项目名称:System.Web.UI.WebControls.WebParts,代码行数:52,代码来源:WebPartTransformer
注:本文中的System.Web.UI.WebControls.WebParts.WebPartTransformer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论