We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Inconsistent accessibility: property type X is less accessible than property Y

wenyonk
wenyonk asked
on
Medium Priority
14,494 Views
Last Modified: 2011-08-18
I am trying to add the C# event below to a custom control.  However I am getting the follwing error, please help.

Inconsistent accessibility: property type 'CA.UI.CustomControls.uccPostalCodeSearchEditor.SelectedItemHandler' is less accessible than property 'CA.UI.CustomControls.uccPostalCodeSearchEditor.SelectedItem'

//Definitions for the SelectedItem Event
//SelectedItem event is raised when the user selects a Record.
delegate void SelectedItemHandler(object sender, PostalCodeSearchEditorSelectedEventArgs e);
private SelectedItemHandler SelectedItemEvent;
public event SelectedItemHandler SelectedItem
{
      add
      {
            SelectedItemEvent = (SelectedItemHandler) System.Delegate.Combine(SelectedItemEvent, value);
      }
      remove
      {
                               SelectedItemEvent = (SelectedItemHandler) System.Delegate.Remove(SelectedItemEvent, value);
      }
}  // END: public event SelectedItemHandler SelectedItem


Also below is the working VB code:

Delegate Sub SelectedItemHandler(ByVal sender As Object, ByVal e As PostalCodeSearchEditorSelectedEventArgs)
Public Event SelectedItem As SelectedItemHandler
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008
Commented:
It means that you can't expose an internal member from a public member:

public delegate void SelectedItemHandler(object sender, PostalCodeSearchEditorSelectedEventArgs e);

Bob

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2008

Commented:
I try to get in the habit of always specifying scope modifiers to all declarations, like classes, properties, events, etc.

Bob

Author

Commented:
Thank you LearnedOne!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.