473,762 Members | 8,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1071
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(str ing 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.MyS ubComponent.Pro perty = 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.els e> schrieb im Newsbeitrag
news:_x******** ***********@big news8.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
312
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 refer me to some documents that will make me understand why this apparent limitation of VB.NET COM builds is acceptable, i.e. why in "good" object code programs I should expect to never have to create large numbers of public class variables that...
7
2615
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 implementing this in C# ? I do not want to use variant (or similar types) because I want to retain a strnong types property. Will I have no choices but to add another property that would set/get the NULL value?
1
2013
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 defined in class interface. If I try to define variables there I get an error : Interfaces can not contain variables ( which is understandable ). Question. How to expose variables. Thanks, Roman Prigozhin
0
1455
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 implemented as IDispatch connection point ), I am trying to create a .NET assembly that will expose the same interface exposed by the other ( binary ) COM components. The problem: ***************** I have no problem exposing properties and methods...
1
2066
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
916
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 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...
9
1659
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 event: 'this allow me to change the textbox on form2 from form1 Form2.text="" 'this allow me to add item to form2 from form1
1
3356
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 developed but instead use properties. /erik
2
1515
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 my_odbcDA, then I make this: my_i_DataAdapter = my_odbcDA;
0
9378
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10137
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9927
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7360
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3914
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.