Windows Phone Developers

Sunday, July 18, 2010

NOT Operator in C# (.NET)

What is the equivalent for VB NOT operator in C#

VB Programmers use NOT operator often. For example,


If Not Range is nothing


or


FlagDone = Not Failed



You can do the same in C# as shown below:

Microsoft.Office.Interop.Excel.Range oRng;

            oRng = null;
            if (object.ReferenceEquals(oRng,null)) 
            {
                oRng = null;
            }

and also in the following context to toggle the Button and TaskPane

Globals.Ribbons.RibbonFB.button1.Enabled  =(!CusPane.Visible);
Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment