Windows Phone Developers

Showing posts with label Enumeration in C#. Show all posts
Showing posts with label Enumeration in C#. Show all posts

Saturday, March 27, 2010

Enumeration in C#

Here is a simple way to declare and use enumerations

Declaration is by using the enum keyword


public enum playerType { ClassA, ClassB, ClassC, Contract }



And you can use as shown below:


ClassTeam CT = new ClassTeam();
CT.PlayerType = ClassTeam.playerType.Contract;

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