Is there a VB.NET equivalent to this? Note in particular the bmp
in the code sample.
public void MyMethod(Object obj)
{
if (obj is Bitmap bmp)
{
// ...
}
}
Or the short pattern matching syntax with is
is exclusive to C#?
EDIT:
I already know these syntaxes:
If TypeOf obj Is Bitmap Then
Dim bmp As Bitmap = obj
' ...
End If
or
Dim bmp As Bitmap = TryCast(obj, Bitmap)
If bmp IsNot Nothing Then
' ...
End If
What I want to know is whether there is something even shorter, like that new C#7 syntax...
Thank you very much.