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

Easier way to expose properties?

ljh
I am using some 3rd party controls to create my own control.

I want to "pass up" many (but not all) of the properties of the 3rd party
controls that I am using to make my control, so that the end user can
customize as much or as little as they wish. But, there are HUNDREDS of
properties (of the combined controls).

Is there an easy way to expose the properties of the controls that I am
using to make my control adn still be able to block the very few properties
that (if set wrong) may make my control act up?

May 21 '06 #1
2 1045
The first solution (politically correct) would be to provide accessors
to all the interested properties. The second solution (also politcially
correct) would be to subclass the original component and hide the
properties you don't want.

There is also a third solution, but it's a bit hackish ... By using
reflection you can create a method SetProperty(string name, object
value) and set the values of the properties. There you can check for
properties you don't want to change.

Regards,
Tasos

May 21 '06 #2
what is wrong with

myComponent.MySubComponent.Property = newValue;

This way you do not need to program the properties again.
There also might be tools/codegenerators which might be able to automatize
the generation of properties for you. If not, you can easily generate a code
generator by yourself using reflection.

--
"ljh" <So**@where.else> schrieb im Newsbeitrag
news:_x*******************@bignews8.bellsouth.net. ..
I am using some 3rd party controls to create my own control.

I want to "pass up" many (but not all) of the properties of the 3rd party
controls that I am using to make my control, so that the end user can
customize as much or as little as they wish. But, there are HUNDREDS of
properties (of the combined controls).

Is there an easy way to expose the properties of the controls that I am
using to make my control adn still be able to block the very few
properties that (if set wrong) may make my control act up?


May 22 '06 #3

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

Similar topics

6
by: Nick Dreyer | last post by:
In VB.NET I would like to not have to create property get/set procedures for every class variable I want to expose to Excel VBA projects in COM builds. Can anyone tell me if that is possible, or...
7
by: MP | last post by:
Hello, I am trying to write a class that will expose some properties. One of the property is extracted from a SQL database and can be NULL or some integer value. Is there a elegant way of...
1
by: Prigozhin Roman | last post by:
Hi , I have a COM object implemented in C# Problem is that my properties ( which defined public in the class ) can not be seen from the outside ( When I call COM ) I can see only functions I...
0
by: Nadav | last post by:
Hi, Introduction: **************** I have a collection of COM objects that support a constant interface, the interface is build of a collection of properties, methods and events ( events are...
1
by: soundar rajan | last post by:
i wanna expose all textbox properties of my own user control at design time. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
by: ljh | last post by:
I am using some 3rd party controls to create my own control. I want to "pass up" many (but not all) of the properties of the 3rd party controls that I am using to make my control, so that the end...
9
by: Dimsion | last post by:
Hi, How do i expose all my forms and it controls to other form in the project? I want to be able to add a form and some control on it, this then be available to all other forms. form1 click...
1
by: erik | last post by:
Hi! Is it possible to expose customer properties used in a class in a web servies. Can I use on a property or how do I do? The thing is that I do not want to use parameters for the method I have...
2
by: Luiz | last post by:
I'm constructing a class to database access using the following interface component : IDBDataAdapter my_i_DataAdapter; ...... The project has an instance of the class OdbcDataAdapter...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.