?
Solved

Enum = Already contains a definition...

Posted on 2006-04-11
4
Medium Priority
?
885 Views
Last Modified: 2012-05-05
Hi

I get the error

The type 'DefaultControlsPlugin.Controls.ElementLabelControl' already contains a definition for 'NameOrDescription'

my code is

Property
=====


public NameOrDescription NameOrDescription
        {
            get { return _eNameOrDescription; }
            set { _eNameOrDescription = value; }
        }

Field
===

private NameOrDescription _eNameOrDescription;

Enum
====

 public enum NameOrDescription { Name, Description };


      
0
Comment
Question by:paulwhelan
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
AGBrown earned 80 total points
ID: 16427886
You have an enum with the same name as a property, and I assume they are both declared inside ElementLabelControl - try changing the property name or moving the enum outside the class definition into the namespace.

Andy
0
 
LVL 12

Expert Comment

by:gbzhhu
ID: 16427895
You are calling the enum and the property the same name which will not work.  either change the enum name to something like enumNameOrDescription or change the property name
0
 
LVL 12

Expert Comment

by:gbzhhu
ID: 16427905
Oops posted before I saw AGBrowns ciomment
0
 
LVL 12

Expert Comment

by:AGBrown
ID: 16427911
:)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question