// return value will be null. Product product = (Product) this.primitivesCache.GetData(selectItemForm.ItemKey); }
例 7.36. Visual Basic .NET
' Prompt the user for the key of the item to be read. If (Me.selectItemForm.ShowDialog() = DialogResult.OK) Then ' Read the item from the cache. If the item is not found in the cache, the ' return value will be null. Dim requestedProduct As Product = DirectCast(Me.primitivesCache.GetData(selectItemForm.ItemKey), Product) End If