Is there any VB.NET equivalent to this? Pay particular attention to bmp in the sample code.
public void MyMethod(Object obj) { if (obj is Bitmap bmp) {
Or a short syntax matching pattern with is exclusively for 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
I want to know if there is something even shorter, like the new C # 7 syntax ...
Thank you very much.
source share