473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to Hide inherited Object members from intellisense?

...Such as ToString(), Equals(), etc.

[EditorBrowsable(EditorBrowsableState.Never)]
public override String ToString() { return base.ToString(); }

The above doesn't work.

Any ideas? And before you ask, Yes I do have a sane reason for wanting
to do this.

Nov 17 '05 #1
4 5388
wa********@yahoo.com wrote:
[EditorBrowsable(EditorBrowsableState.Never)]
public override String ToString() { return base.ToString(); }

The above doesn't work.


Have you tried just the Browsable attribute?

[Browsable(false)]
public int MyProperty {
get {
// Insert code here.
return 0;
}
set {
// Insert code here.
}
}

Nov 17 '05 #2
Browsable refers to the property window not intellisense when you are
coding.

Nov 17 '05 #3
So it does! My mistake.

I just tried the EditorBrowsable attribute on a property and also on a
method and it worked correctly. I then tried it on an overridden
ToString method and it *did not* work on that method.

Next I created a simple class with one overridable method and a derived
class that overrides the method with an additional method that was not
part of the base class. It seems that if the overridden method is
hidden using the EditorBrowsable attribute, then the base class method
is exposed. This was coded in VB.Net. I then repeated the test in C#
but the EditorBrowsable attribute seemed to have no effect either way.
It seems very strange.

Nov 17 '05 #4
Yeah, I don't understand it really. I'm not really interested in
overriding just hiding the methods from the intellisense window.

I guess what I'd really like to do is apply the EditorBrowsable
attribute to an inherited method like ToString(); Just don't know how.

I wish something like this would work to do it:

class MyClass : Object
{
MyClass() {}

[EditorBrowsable(EditorBrowsableState.Never)]
public String ToString();
}

Of course it's not valid but that's my intent. Thanks for the
investigative effort Chris.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Iulian Ionescu | last post by:
I have the following problem. I derived a class from ArrayList to provide some additional events I need. Then I derived 2 different classes from this one and each of them defines an indexer that...
8
by: Flare | last post by:
Hi Im creating an Assembli with serval class's wich only contents is static properties. (Im using this class to access global Connections string and.etc. Is all good. But to simplify th euse...
4
by: C-Sharper or C-Hasher, one of the two | last post by:
Hi, I have a C# class libary (Class1) which is inherited by another class in a Windows Forms app. I want this other class to implement some, but not all of the features of the base class. How...
6
by: Alex Sedow | last post by:
Example 1 interface I { string ToString(); } public class C : I { public void f() {
1
by: wackyphill | last post by:
...Such as ToString(), Equals(), etc. public override String ToString() { return base.ToString(); } The above (in C#) doesn't work.
14
by: lovecreatesbea... | last post by:
Could you tell me how many class members the C++ language synthesizes for a class type? Which members in a class aren't derived from parent classes? I have read the book The C++ Programming...
3
by: Antonio | last post by:
Hi, I have an abstract ClassA in ProjectA: Public MustInherit Class ClassA : End Class I inherit ClassA on ClassB from ProjectB: Public Class ClassB Inherits ProjectA.ClassA
19
by: jan.loucka | last post by:
Hi, We're building a mapping application and inside we're using open source dll called MapServer. This dll uses object model that has quite a few classes. In our app we however need to little bit...
5
by: wal | last post by:
Hello, I'm using __declspec(property) to access get/set methods as properties (like in C# and VB.NET). Now, the problem is that both the property name and the get/set methods show in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.