What's the best way to, in the general case, track changes to an object's
public fields and properties? In a lot of applicatoins I've seen bahavior
consistant with simple periodic checking from a timer, or checking otherwise
initiated from a user event. I don't believe I can make that approach work
in the project I'm working on... are there other ways to do this, where I
can actually get an event raised on a field change, that don't involve using
dynamically emitted wrapper types?
Paul 3 2602
On Aug 27, 3:52 pm, "PJ6" <no...@nowhere. netwrote:
What's the best way to, in the general case, track changes to an object's
public fields and properties? In a lot of applicatoins I've seen bahavior
consistant with simple periodic checking from a timer, or checking otherwise
initiated from a user event. I don't believe I can make that approach work
in the project I'm working on... are there other ways to do this, where I
can actually get an event raised on a field change, that don't involve using
dynamically emitted wrapper types?
Paul
Is this object one you created or one you don't have the source
available to? The simplest way to track changes (imo) is to fire an
event from the Set accessor of the property if the value changed. If
you can't modify the source, perhaps you could inherit the class and
add the functionality? If you don't have the source, and can't inherit/
override the properties things will be more difficult.
Thanks,
Seth Rowe
PJ6 wrote:
What's the best way to, in the general case, track changes to an object's
public fields and properties? In a lot of applicatoins I've seen bahavior
consistant with simple periodic checking from a timer, or checking otherwise
initiated from a user event. I don't believe I can make that approach work
in the project I'm working on... are there other ways to do this, where I
can actually get an event raised on a field change, that don't involve using
dynamically emitted wrapper types?
If you take the Windows Controls as an example, they all seem to sport
lots of *Changed events that get raised when the associated Property is
... er .. changed (e.g. TextChanged, SelectedIndexCh anged, EnabledChanged) .
"track changes to an object's public /fields/"?
Not a chance. If you expose a field, then you won't have the slightest
idea how or when it gets changed. Wrap it up in a Property.
HTH,
Phill W.
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:fb******** **@south.jnrs.j a.net...
"track changes to an object's public /fields/"?
Not a chance. If you expose a field, then you won't have the slightest
idea how or when it gets changed. Wrap it up in a Property.
Yep, that's what I thought. No getting around having to use IL... but this
will solve a problem I've been thinking about for years. More advanced than
I would have liked, but probably worth the investment.
Paul This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: JLuppens |
last post by:
Does anyone know if there
is a way to track changes in a text field like word does? I am using
a SQL2000 database and can use either VB.Net or Access. The field is
either ntext or Varchar. I would like to show users the changes
other users have made to a text field using a other font or font
color.
Thanks
|
by: D Witherspoon |
last post by:
I am developing a Windows Forms application in VB.NET that will use .NET
remoting to access the data tier classes.
A very simple way I have come up with is by creating typed (.xsd) datasets.
For example dsParts.xsd and including that in the data tier. I then will
create a class that looks like this
Public Class CPart
Inherits dsParts
|
by: Uwe Range |
last post by:
Hi to all,
I am developing a database where, with time, it proved to be necessary
to keep track of the changes to the data. It is fairly easy to keep
track of the time when a record was changed (afterupdate event)
-> Is there there a smart way of finding out which field has been
changed? I don't want to set a procedure on every field on the edit
form for keeping track of that, because the forms will be changed from
time to time.
|
by: Alfred Taylor |
last post by:
I'm testing the waters of n-tier development and I ran into a scenario that
I'm not sure what the best solution would be. I have a Company object which
contains a collection of contacts retrieved from a database.
In the presentation layer, the user will be able to add/delete/modify this
collection in which case it needs to be synced with the database.
The question is basically how best to do this? Aside from overriding the
add/remove...
|
by: Daniel Walzenbach |
last post by:
Hi,
I need to track all changes made to an object. Consider the following class:
Public Class Dog
| |
by: Gummy |
last post by:
Hello,
I created a user control that has a ListBox and a RadioButtonList (and other
stuff). The idea is that I put the user control on the ASPX page multiple
times and each user control will load with different data (locations,
departments, etc.).
|
by: Tomas |
last post by:
Hi,
I am a VB.NET newbie that would like to know the best practise when
working with objects and undo user changes to objects properties.
Problem
The system allows the user to change properties of an object; the
system then does some time consuming calculation and provide a solution
to the user. If the user found the solution unsatisfactory, he/she
could either continue making more changes or undo all changes done
|
by: De_Cisse |
last post by:
Hi all,
I'm working on an application in which I already make some
preparations to be able to work in a frontend and backend database,
even if this isn't the issue a this moment. I'm using VBA classes for
this (I know not the easiest way, but I have made some considerations
and I want to to it this way as VBA classes are some new stuff to
explore for me).
In a class 'client' I get the data from the database and put it in
|
by: dirksza2009 |
last post by:
Hi,
I've made a multi user (4 end users) database in Access 2000. I've made data tables, reference tables etc which sits on a shared drive and I've made individual front ends for the end users which gives them specific views of the data.
I'd like to track all the changes made to a record which works find with the following code :
basAuditTrail:
Option Compare Database
Const cDQ As String = """"
Sub AuditTrail(frm As Form, recordid As...
|
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...
|
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,...
| |
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...
|
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...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |