IntelliSense question

K

Kimmo Laine

Hi,

is there a way to hide inherited methods from the IntelliSense-menu in
VS2005?

Lets say that i have the following:

internal class MyClass {
public const int MAX_COUNT = 10;
}

When i write in the ditor "MyClass." menu pops up with the following items

Equals
MAX_COUNT
ReferenceEquals

Is there a way to hide the Equals and ReferenceEquals, by using some
attribute or something?


thx
Kimmo
 
D

Dave Sexton

Hi Kimmo,

The following works as long as MyClass is declared in another project. i.e.,
Intellisense seems to ignore EditorBrowsableAttribute on classes within the
current project, but it works when using a class from an external assembly.

public class MyClass
{
[System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)]
public static new bool Equals(object objA, object objB)
{
return Object.Equals(objA, objB);
}

[System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)]
public static new bool ReferenceEquals(object objA, object objB)
{
return Object.ReferenceEquals(objA, objB);
}

public const int MAX_COUNT = 10;
}


I'm not sure how important it is that you keep MyClass internal, but that
wouldn't work in this scenario.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top