Question

Asked:
Asked By:
Aug 11 2008   8:43 PM GMT
M3RL1N   30 pts.

C# Creating Class Libraries with Enum


C#, Visual Studio 2008, DLL, Class Library, Enumeration

Ok,

I'm trying to create a class library that enables me to use a enum. Simple I thought. But the

more and more I dig the deeper the rabbit whole goes. I've tried to Substitute the obvious DDD in

the public void Main method still no luck. I'm able to compile but my error "is a type which isn't

valid is DataObjects.DDD is a 'type', which is not valid in the given context. Maybe someone

can correct the error in my ways. Thanks.



///--------------------Class Library Code.

public enum DDD : int{



UserCentric = 1,

RoleCentric = 2 ,

TeamCentric = 3,

OfficeCentric = 4,

LineOfBusinessCentric = 5 }







class Document

{







public void Main(DDD DDD)

{







switch (DDD)

{

case DDD.UserCentric:



System.Console.WriteLine("UserCentric");



break;

case DDD.RoleCentric:

Debug.WriteLine("RoleCentric");





break;

case DDD.TeamCentric:

Debug.WriteLine("TeamCentric");



break;

case DDD.OfficeCentric:

Debug.WriteLine("OfficeCentric");



break;

case DDD.LineOfBusinessCentric:

Debug.WriteLine("LineOfBusinessCentric");



break;





;

///------------------------------------------end of class library code.

using System;

using System.Configuration;

using System.Data;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;





public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

string mm;



mm = DocumentDataObject.DDD;





mm = Label1.Text;



}

}

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


Start this Answer and Earn your Knowledge Points!

By clicking "Create Answer", you can write the answer to this question that can be improved upon by your peers using the Answer Wiki.

Browse more Questions and Answers on Development.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register