I have a VB class which overloads the Not operator; this doesn't seem to be usable from C# applications.
Public Shared Operator Not(item As MyClass) As Boolean
Return False
End Operator
I can use this in VB.NET:
If Not MyClassInstance Then
' Do something
End If
I am trying to us this in a C# application but it won't build.
if (!MyClassInstance)
{
// do something
}
I get the error
Operator '!' cannot be applied to operand of type 'MyClass'
Can anyone tell me what I am missing?
if(!MyClassInstance()) { // do something }