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

Hide a componet?

Is it possible to hide a component that is used as a base class for other
components?

I have two components that perform the same job. Their only difference is
that one works with objects, and the other works with data rows. So, I
derived both from a common base component and used a GoF Template Method
pattern to encapsulate the parts that differ in the derived components.

Here's my problem: I can't make the base component abstract, due to visual
inheritance limitations. (.NET needs to instantiate the base component to
instantiate the derived components.) But that means a developer using my
package could instantiate the base component, which I obviously don't want.

So, is there a simple way to hide the base component from a developer using
the controls, so that only the derived controls are exposed? Thanks.

--
David Veeneman
Foresight Systems
Aug 19 '06 #1
4 1659
David,

You can always set the components visiblity to "private".
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"David Veeneman" <da****@nospam.com (domain is my last name)wrote in
message news:eN**************@TK2MSFTNGP03.phx.gbl...
Is it possible to hide a component that is used as a base class for other
components?

I have two components that perform the same job. Their only difference is
that one works with objects, and the other works with data rows. So, I
derived both from a common base component and used a GoF Template Method
pattern to encapsulate the parts that differ in the derived components.

Here's my problem: I can't make the base component abstract, due to visual
inheritance limitations. (.NET needs to instantiate the base component to
instantiate the derived components.) But that means a developer using my
package could instantiate the base component, which I obviously don't
want.

So, is there a simple way to hide the base component from a developer
using the controls, so that only the derived controls are exposed? Thanks.

--
David Veeneman
Foresight Systems

Aug 19 '06 #2
Nicholas Paldino [.NET/C# MVP] wrote:
You can always set the components visiblity to "private".
I suspect you can't make public descendants of private components.

-- Barry

--
http://barrkel.blogspot.com/
Aug 19 '06 #3
I did discover that I could make the base component abstract, at the cost of
sacrificing Designer support for the derived components. However, since the
components don't have visual elements, and they don't contain other
components, it's no real sacrifice.

--
David Veeneman
Foresight Systems
Aug 20 '06 #4
Barry,

You can't, but if the controls or members of your public component are
private, then derived classes can't access them.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Barry Kelly" <ba***********@gmail.comwrote in message
news:dg********************************@4ax.com...
Nicholas Paldino [.NET/C# MVP] wrote:
> You can always set the components visiblity to "private".

I suspect you can't make public descendants of private components.

-- Barry

--
http://barrkel.blogspot.com/

Aug 21 '06 #5

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

Similar topics

2
by: IMRAN SAROIA | last post by:
Dear friends, I have implemented COM componet from .Net Assembly to be used by my old apps by creating a class and compiling it as an assembly and also regestring it. How can we implement...
5
by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main...
3
by: alex | last post by:
I'd like to have a show/hide widget on my web site, kind of like "show details" / "hide details" in Google Groups. Is there a tutorial explaining how to make them? Google's is a bit complex and...
7
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field...
5
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
6
by: Ralph | last post by:
Hi, I was reading effictive C++ and some other books again and they all tell you about hiding implementation details (proxy/pimpl/inheritance) but they never really explain when to use it. I...
1
by: purusabkaguru | last post by:
When I develop com componet in .net enviroment then it is managed or unmanaged?How?
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.