• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 972
  • Last Modified:

Enum = Already contains a definition...

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
paulwhelan
Asked:
paulwhelan
  • 2
  • 2
1 Solution
 
AGBrownCommented:
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
 
gbzhhuCommented:
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
 
gbzhhuCommented:
Oops posted before I saw AGBrowns ciomment
0
 
AGBrownCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now