Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

C# Creating Class Libraries with Enum

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;



}

}
Sign In or Register to comment.