Private KeyValue As String = ""
Private KeyInternedValue As String = ""
Private KeyLowercaseInternedValue As String = ""
Public ReadOnly Property KeyLowercaseInterned() As String Implements Infragistics.Shared.IKeyedSubObjectEx.KeyLowercaseInterned
Get
If Me.KeyValue.Length = 0 Then Return Me.KeyValue
' If the string hasn't changed since the last internment
' then return the cached value
If Object.ReferenceEquals(Me.KeyValue, Me.KeyInternedValue) = True Then
If Not Me.KeyLowercaseInternedValue Is Nothing Then
Return Me.KeyLowercaseInternedValue
End If
End If
' Intern the key and save the interned string reference
Me.KeyInternedValue = String.Intern(Me.KeyValue)
' Intern the string converted to lowercase so we can do case
' insensitive compares
Me.KeyLowercaseInternedValue = String.Intern(Me.KeyInternedValue.ToLower())
Return Me.KeyLowercaseInternedValue
End Get
End Property