Reputation: 121
I want to learn how can I use Or command (VB.NET) in C#?
I have an example:
foundCommand = _applicationObject.Commands.AddNamedCommand(_addInInstance, name, name, caption, _
True, iconID, Nothing, vsCommandStatus.vsCommandStatusSupported Or vsCommandStatus.vsCommandStatusEnabled)
I want to use vsCommandStatus.vsCommandStatusNotSupported Or vsCommandStatus.vsCommandStatusEnabled together in C#.
Upvotes: 1
Views: 293
Reputation: 726609
Here is a little table of VB.NET to C# operators:
VB.NET C#
-------- --
And &
AndAlso &&
Or |
OrElse ||
Xor ^
Mod %
Not !
Upvotes: 4
Reputation: 190943
Use the bitwise OR operator |
to link enum flag values, which is your case.
vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled
For conditionals or Boolean values, use the logical OR operator ||
.
Upvotes: 4