473,385 Members | 1,356 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,385 software developers and data experts.

Making a field/operation invisible for intellitip

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
8 1456
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
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

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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
2
by: Not Me | last post by:
Hi, In a datagrid's itemcommand method, I can use DataGridCommandEventArgs/item/cells/text to bring up a specific field from a row that was accessed. However, I wish to lookup data from that...
8
by: Lars-Erik Aabech | last post by:
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...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
4
by: telesphore4 | last post by:
Is there a better way to make the subclassing of built-in types stick? The goal is to have the the fields of a class behave like strings with extra methods attached. That is, I want the fact that...
1
by: AndrewF | last post by:
Hi all, I've been trying to google this bug for a few hours and haven't turned up anything which leads me to believe the way I'm framing the question is the way someone else has. Anyway...
4
by: rcwoodard | last post by:
Hello all. I have a continuous form that I need to make a field invisible or visible depending on the selection in another field. I have tried using Form_Current() and the following code: ...
1
by: LOCAFO | last post by:
I have a form that I'm trying to modify. Code uses html and javascript. The form has the the field name txtAcctType and the 3 options are checking, savings and Money Market. If checking is...
0
by: Joel Ryan | last post by:
hello, I'm currently working with a xamdatagrid, this grid is bound to a dataset as its source, and what im trying to do is, based on the column name(or the field name as the xamdatagrid calls it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.