473,657 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

i love reflection:)

guy
just discovered that the combination of visual inheritance and reflection can
eliminate most of the databinding i would normally do, providing the design
is right!

and its only taken me 4 years lol

--guy--

Feb 26 '06 #1
7 1076
Guy,
just discovered that the combination of visual inheritance and reflection
can
eliminate most of the databinding i would normally do, providing the
design
is right!

and its only taken me 4 years lol

And your program is probably performing with the same speed as a VB6
program.

Cor
Feb 26 '06 #2
CMM
That's a little harsh, Cor. I can see how Databinding /w Reflection could
make VB much more RAD akin to MS Access and might remove a lot of the
tediousness with first time set up of forms. If Microsoft has tied the
TableAdaptor to the Dataset, they might as well go the whole 9 yards.

--
-C. Moya
www.cmoya.com
"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Guy,
just discovered that the combination of visual inheritance and reflection
can
eliminate most of the databinding i would normally do, providing the
design
is right!

and its only taken me 4 years lol

And your program is probably performing with the same speed as a VB6
program.

Cor

Feb 26 '06 #3
In article <#n************ **@TK2MSFTNGP14 .phx.gbl>,
no************@ planet.nl says...
Guy,
just discovered that the combination of visual inheritance and reflection
can
eliminate most of the databinding i would normally do, providing the
design
is right!

and its only taken me 4 years lol

And your program is probably performing with the same speed as a VB6
program.

Cor

I'm intrigued do you have an example you could share?
Feb 26 '06 #4
guy
hi,
cant give you the code as its in a number of methods in a couple of classes
but:-
in the base form...
load event get a hashtable of all the controls you might want to bind to
add an event handler that binds to the leave event or similar (1 handler for
all the controls) that handler can then use reflection to update the
appropriate property in the business object.
declare a business object of base type
write a display method that uses reflection to display all the properies in
the business object, call this from the event raised in the business object
(below)
ensure that when you name controls in the form they correspond to property
names in the business class, with + txt, lbl or whatever

in the base business class...
raie an event when any property you are interested in changes value

thats pretty much it (written at 3am so i may have missed a few bits!)

drop me an email to gu**********@ho tmail.com and i will send you the code
when i have it fully tidied up

cheers

guy
"sp*****@spamsu x.net" wrote:
In article <#n************ **@TK2MSFTNGP14 .phx.gbl>,
no************@ planet.nl says...
Guy,
just discovered that the combination of visual inheritance and reflection
can
eliminate most of the databinding i would normally do, providing the
design
is right!

and its only taken me 4 years lol

And your program is probably performing with the same speed as a VB6
program.

Cor

I'm intrigued do you have an example you could share?

Feb 27 '06 #5
So you're not really using DataBinding, but just updating the appropriate
Property when a control changes?
And how does it work when one of the property's of your business object
changes, and the Form must be updated?

Pieter

"guy" <gu*@discussion s.microsoft.com > wrote in message
news:B7******** *************** ***********@mic rosoft.com...
hi,
cant give you the code as its in a number of methods in a couple of
classes
but:-
in the base form...
load event get a hashtable of all the controls you might want to bind to
add an event handler that binds to the leave event or similar (1 handler
for
all the controls) that handler can then use reflection to update the
appropriate property in the business object.
declare a business object of base type
write a display method that uses reflection to display all the properies
in
the business object, call this from the event raised in the business
object
(below)
ensure that when you name controls in the form they correspond to property
names in the business class, with + txt, lbl or whatever

in the base business class...
raie an event when any property you are interested in changes value

thats pretty much it (written at 3am so i may have missed a few bits!)

drop me an email to gu**********@ho tmail.com and i will send you the code
when i have it fully tidied up

cheers

guy

Feb 27 '06 #6
"CMM" <cm*@nospam.com > wrote in message
news:uA******** *****@TK2MSFTNG P15.phx.gbl...
That's a little harsh, Cor. I can see how Databinding /w Reflection could
Actually, I think it was a compliment.
make VB much more RAD akin to MS Access and might remove a lot of the
tediousness with first time set up of forms. If Microsoft has tied the
TableAdaptor to the Dataset, they might as well go the whole 9 yards.

--
-C. Moya
www.cmoya.com


--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Feb 27 '06 #7
guy
Hi Pieter,
no i am not using data binding (except for a few things) it is something i
wanted to move awaw from. If a property in my business object changes i use
an event to update the form.

--guy--

"Pieter" wrote:
So you're not really using DataBinding, but just updating the appropriate
Property when a control changes?
And how does it work when one of the property's of your business object
changes, and the Form must be updated?

Pieter

"guy" <gu*@discussion s.microsoft.com > wrote in message
news:B7******** *************** ***********@mic rosoft.com...
hi,
cant give you the code as its in a number of methods in a couple of
classes
but:-
in the base form...
load event get a hashtable of all the controls you might want to bind to
add an event handler that binds to the leave event or similar (1 handler
for
all the controls) that handler can then use reflection to update the
appropriate property in the business object.
declare a business object of base type
write a display method that uses reflection to display all the properies
in
the business object, call this from the event raised in the business
object
(below)
ensure that when you name controls in the form they correspond to property
names in the business class, with + txt, lbl or whatever

in the base business class...
raie an event when any property you are interested in changes value

thats pretty much it (written at 3am so i may have missed a few bits!)

drop me an email to gu**********@ho tmail.com and i will send you the code
when i have it fully tidied up

cheers

guy


Feb 28 '06 #8

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

Similar topics

0
1376
by: A. Wiebenga | last post by:
Hi all! I am a student at the Hogeschool van Arnhem en Nijmegen in Holland. I am currently involved in a research project regarding Reflection. Purpose of the research project is to document what Reflection is (I can answer this question myself), what kind of Reflection Techniques there are (.NET Reflection, Python Reflection etc. I can answer this one myself too). The main question I need to answer is related to the implementation of...
10
7360
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a Windows.Forms.UserControl in a COM environment, i.e. I want to host that control in a COM host. So far, so good, I can host it, but I can not reach the parent COM object from the control (Parent property is null :( ). I have stopped the control in the...
2
864
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray that has the information, but we as developers have no way to access this information. I have come up with a solution for the problem, (as I am sure many others have) using reflection. Here is some sample code that will print out the auto...
8
16890
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. This works fine if all of the properties are at the top (root level) of the model but I'd like to keep them in nested classes to organize them better. So, for example, part of my data model looks like this (simplified) : public class MainClass
0
1545
by: Shawn Hogan | last post by:
Hi everyone, I've been trying to execute a control's private event code via reflection from another class with the goal of potentially doing some unit testing. The examples below are trying to execute button2's click event. This works great when i know the name of the method that i want to invoke. I do so by doing this: Dim AssemblyPointer As Reflection.Assembly
9
3844
by: Kuberan Naganathan | last post by:
Hello all Does anyone know of a good way to use reflection in c++? I don't mean simply using rtti or dynamic casting. I'm talking about java/c# style reflection where an actual instance of an object can be constructed through reflection and method calls can be made via the reflection apis.
17
2300
by: raylopez99 | last post by:
What good is C# Reflection, other than to find out what types are in an assembly? And to dynamically invoke methods in an assembly (.dll or .exe)? Also, bonus question, can you use Reflection to build a compiler? One that will construct a user defined class "on the fly" (literally, the user defines a class, instantiates it, and runs it from the console mode, all the while prompted by the program)? I guess so, but my final question...
0
1692
by: Gustavo Arriola | last post by:
Hola a todos! Estoy intentando ejecutar un método usando Reflection. El código es el siguiente: public static void SoapHandler(Exception Error) { try { Type assemblyType;
0
8394
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
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
8732
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
8503
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
6164
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
5632
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
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.