By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,880 Members | 2,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,880 IT Pros & Developers. It's quick & easy.

Making a field/operation invisible for intellitip

P: n/a
Hi!

I've been looking around for an attribute that tells the intellitip thingy
to skip some field or operation. Is there any?
IE. a ListControl object has the DataSource property, but not all of the
inherited classes "supports" that public property, although you can use
them. Some of these properties are hidden from intellitip, but doesn't throw
a compiler error.

Ex.:
[Invisible(true)]
public bool NotImplementedBoolean
{
// need this to derive from an abstract class.
}

L-E
Jul 21 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
I do not think there is anything for that.
Although the name of the class System.ComponentModel.BrowsableAttribute
implies
it does this, it is for controlling which properties of a visual designer to
be shown in the properties window.
http://msdn.microsoft.com/library/de...ClassTopic.asp

But anyway, since you have to override a public member of a base class,
that member will be visible anyway.

Just throw a NotImplementedException or a NotSupportedException.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi!

I've been looking around for an attribute that tells the intellitip thingy
to skip some field or operation. Is there any?
IE. a ListControl object has the DataSource property, but not all of the
inherited classes "supports" that public property, although you can use
them. Some of these properties are hidden from intellitip, but doesn't
throw a compiler error.

Ex.:
[Invisible(true)]
public bool NotImplementedBoolean
{
// need this to derive from an abstract class.
}

L-E

Jul 21 '05 #2

P: n/a
I know about that one ;)
My current implementations of the methods throw a NotImplementedException..
But why show the method at all if that's what it does? :)

L-E

"Dennis Myrén" <de****@oslokb.no> wrote in message
news:fU****************@news2.e.nsc.no...
I do not think there is anything for that.
Although the name of the class System.ComponentModel.BrowsableAttribute
implies
it does this, it is for controlling which properties of a visual designer
to be shown in the properties window.
http://msdn.microsoft.com/library/de...ClassTopic.asp

But anyway, since you have to override a public member of a base class,
that member will be visible anyway.

Just throw a NotImplementedException or a NotSupportedException.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi!

I've been looking around for an attribute that tells the intellitip
thingy to skip some field or operation. Is there any?
IE. a ListControl object has the DataSource property, but not all of the
inherited classes "supports" that public property, although you can use
them. Some of these properties are hidden from intellitip, but doesn't
throw a compiler error.

Ex.:
[Invisible(true)]
public bool NotImplementedBoolean
{
// need this to derive from an abstract class.
}

L-E


Jul 21 '05 #3

P: n/a

Unfortunately, since these methods is overridden from the base class, even
if you did succeed hiding you overridden
version, the version of the base class will still be visible through
IntelliSense(reflection).

Do you have to derive that class?
If there are several abstract members that you do not actually implement,
does it really makes sense to
derive this class?
If the base class declares members as abstract, it really means it demands
an implementation of those members.

If you are in control of the base class, there could be lots of solutions,
though.
You could define two abstract base classes, one basic and one extended that
derives the basic one.
Or you could place the methods in an interface, and have those concrete
classes
that actually do implement the extended funtionality implement that
interface.

Well, it is just my opinion, although I probably did not provide much help.


--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:eT**************@TK2MSFTNGP11.phx.gbl...
I know about that one ;)
My current implementations of the methods throw a
NotImplementedException.. But why show the method at all if that's what it
does? :)

L-E

"Dennis Myrén" <de****@oslokb.no> wrote in message
news:fU****************@news2.e.nsc.no...
I do not think there is anything for that.
Although the name of the class System.ComponentModel.BrowsableAttribute
implies
it does this, it is for controlling which properties of a visual designer
to be shown in the properties window.
http://msdn.microsoft.com/library/de...ClassTopic.asp

But anyway, since you have to override a public member of a base class,
that member will be visible anyway.

Just throw a NotImplementedException or a NotSupportedException.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi!

I've been looking around for an attribute that tells the intellitip
thingy to skip some field or operation. Is there any?
IE. a ListControl object has the DataSource property, but not all of the
inherited classes "supports" that public property, although you can use
them. Some of these properties are hidden from intellitip, but doesn't
throw a compiler error.

Ex.:
[Invisible(true)]
public bool NotImplementedBoolean
{
// need this to derive from an abstract class.
}

L-E



Jul 21 '05 #4

P: n/a
Hi again :)

It's not much of a problem, and I appreciate your opinion. I control the
base class and will probably remove the method I din't implement. None of
the derived classes implement it, and there are no calls to it. It was only
put there for "future use"..
The question was mostly for fun. If MS can hide methods, I want to too ;)

L-E

"Dennis Myrén" <de****@oslokb.no> wrote in message
news:_i****************@news2.e.nsc.no...

Unfortunately, since these methods is overridden from the base class, even
if you did succeed hiding you overridden
version, the version of the base class will still be visible through
IntelliSense(reflection).

Do you have to derive that class?
If there are several abstract members that you do not actually implement,
does it really makes sense to
derive this class?
If the base class declares members as abstract, it really means it demands
an implementation of those members.

If you are in control of the base class, there could be lots of solutions,
though.
You could define two abstract base classes, one basic and one extended
that derives the basic one.
Or you could place the methods in an interface, and have those concrete
classes
that actually do implement the extended funtionality implement that
interface.

Well, it is just my opinion, although I probably did not provide much
help.


--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:eT**************@TK2MSFTNGP11.phx.gbl...
I know about that one ;)
My current implementations of the methods throw a
NotImplementedException.. But why show the method at all if that's what
it does? :)

L-E

"Dennis Myrén" <de****@oslokb.no> wrote in message
news:fU****************@news2.e.nsc.no...
I do not think there is anything for that.
Although the name of the class System.ComponentModel.BrowsableAttribute
implies
it does this, it is for controlling which properties of a visual
designer to be shown in the properties window.
http://msdn.microsoft.com/library/de...ClassTopic.asp

But anyway, since you have to override a public member of a base class,
that member will be visible anyway.

Just throw a NotImplementedException or a NotSupportedException.
--
Regards,
Dennis JD Myrén
Oslo Kodebureau
"Lars-Erik Aabech" <la******@newsgroup.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi!

I've been looking around for an attribute that tells the intellitip
thingy to skip some field or operation. Is there any?
IE. a ListControl object has the DataSource property, but not all of
the inherited classes "supports" that public property, although you can
use them. Some of these properties are hidden from intellitip, but
doesn't throw a compiler error.

Ex.:
[Invisible(true)]
public bool NotImplementedBoolean
{
// need this to derive from an abstract class.
}

L-E



Jul 21 '05 #5

P: n/a
Hi Lars-Erick,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to hide a method which is
derived from base class. If there is any misunderstanding, please feel free
to let me know.

I agree with Dennis's idea. As far as I know, this is impossible for us to
achieve this. Because according to the OOP specs, a derived class should
"support" all the base class methods. So if the based class is abstract, we
have to implement all it's methods.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #6

P: n/a
Hi!

I think we're getting off track from the real question here. Say I have a
class with no relation to any objects what-so-ever, and that class has a
method that I didn't implement, but I'd like to keep it around for some
weird reason. In the meantime, I don't want anyone to "see" that the method
exists when using the class in Visual Studio, so I'd like to add an
attribute or something (except a comment block around it ;) ) so it doesn't
show up in the intellitip dropdown. Kind of like making it private, just
not.. Kind of silly too, but hey...

L-E

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:qS**************@cpmsftngxa10.phx.gbl...
Hi Lars-Erick,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to hide a method which is
derived from base class. If there is any misunderstanding, please feel
free
to let me know.

I agree with Dennis's idea. As far as I know, this is impossible for us to
achieve this. Because according to the OOP specs, a derived class should
"support" all the base class methods. So if the based class is abstract,
we
have to implement all it's methods.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #7

P: n/a
Hi Lars,

Now I understand that you need to hide a certain field/method in the
IntelliSense. However, as far as I know, there isn't such attribute
available to hide the method. The only way is to make it private.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #8

P: n/a
OK, tnx! :)

Although, I've heard that ie. the CheckedListBox (i think in the
System.Windows.Forms namespace) has a DataSource property that isn't
shown... how did MS do that? :P (You can assign to it and make it work, but
it doesn't exist according to the docs or intellisense)

L-E

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:9m**************@cpmsftngxa10.phx.gbl...
Hi Lars,

Now I understand that you need to hide a certain field/method in the
IntelliSense. However, as far as I know, there isn't such attribute
available to hide the method. The only way is to make it private.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.