vb System.DirectoryServices.PropertyCollection.IDictionary.Item类(方法)实例源码

下面列出了vb System.DirectoryServices.PropertyCollection.IDictionary.Item 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.DirectoryService   
Public Property Item(ByVal key As Object) As Object Implements IDictionary.Item
    Get

        ' If this key is in the dictionary, return its value.
        Dim index As Integer
        If TryGetIndexOfKey(key, index) Then

            ' The key was found return its value.
            Return items(index).Value
        Else

            ' The key was not found return null.
            Return Nothing
        End If
    End Get

    Set(ByVal value As Object)
        ' If this key is in the dictionary, change its value. 
        Dim index As Integer
        If TryGetIndexOfKey(key, index) Then

            ' The key was found change its value.
            items(index).Value = value
        Else

            ' This key is not in the dictionary add this key/value pair.
            Add(key, value)
        End If
    End Set
End Property


问题


面经


文章

微信
公众号

扫码关注公众号