vb System.Windows.Automation.Provider.ISelectionItemProvider.RemoveFromSelection类(方法)实例源码

下面列出了vb System.Windows.Automation.Provider.ISelectionItemProvider.RemoveFromSelection 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Windows.Automation.Provide   
''' <summary>
''' Removes the item from the selection in list boxes that support 
''' multiple selection or no selection at all.
''' </summary>
''' <remarks>
''' selectedItems is the collection of selected ListItems.
''' </remarks>
Public Sub RemoveFromSelection() Implements ISelectionItemProvider.RemoveFromSelection
    ' Return if the item is already selected.
    If (CType(Me, ISelectionItemProvider)).IsSelected Then
        Return
    End If
    If (CType(Me, ISelectionProvider)).IsSelectionRequired And selectedItems.Count <= 0 Then
        Throw New InvalidOperationException("Operation cannot be performed.")
    End If

    selectedItems.Remove(Me)
    ' TODO: Update UI.
End Sub

作者:VB.NET开发    项目:System.Windows.Automation.Provide   
''' <summary>
''' Specifies whether the item is selected.
''' </summary>
''' <remarks>
''' selectedItems is the collection of selected ListItems.
''' </remarks>
Public ReadOnly Property IsSelected() As Boolean Implements ISelectionItemProvider.IsSelected
    Get
        Return selectedItems.Contains(Me)
    End Get
End Property


问题


面经


文章

微信
公众号

扫码关注公众号