Do you receive the Programmer's Heaven newsletter? If not, why not subscribe?

C# & VB.NET School Support

Moderators: None (Apply to moderate this forum)
Number of threads: 117
Number of posts: 204

This Forum Only
Post New Thread

Report
C# Creating Class Libraries with Enum Posted by xxMRLNxx on 11 Aug 2008 at 2:07 PM
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;



}

}



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A bootstrapLabs project.