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

Listing all class properties

Stu
Hi,

I have a class with quite a large number of properties that stores booking
information.. I need to create an audit trail for these bookings every time
something is changed. I thought about listing all the properties in the
class and their values and writing a text file for each time the booking
information is changed.

2 questions:
1 - Does this sound like a good way of doing it?
2 - Is there any way of enumerating all of the properties & their values?

Thanks in advance,

Stu
Nov 21 '05 #1
2 987
You can do that by reflection, by calling the GetMembers() method of a Type
object. The following code is just what you asked (except it is in C#):

http://www.devx.com/tips/Tip/21232

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Stu" <s.****@cergis.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

I have a class with quite a large number of properties that stores booking
information.. I need to create an audit trail for these bookings every time something is changed. I thought about listing all the properties in the
class and their values and writing a text file for each time the booking
information is changed.

2 questions:
1 - Does this sound like a good way of doing it?
2 - Is there any way of enumerating all of the properties & their values?

Thanks in advance,

Stu

Nov 21 '05 #2
Do the reflection give the value of the property at run -time?

If it is just to view the members of each class , then it can also be done
using the class view in the VIEW menu.

nafri
"Manohar Kamath" wrote:
You can do that by reflection, by calling the GetMembers() method of a Type
object. The following code is just what you asked (except it is in C#):

http://www.devx.com/tips/Tip/21232

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"Stu" <s.****@cergis.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi,

I have a class with quite a large number of properties that stores booking
information.. I need to create an audit trail for these bookings every

time
something is changed. I thought about listing all the properties in the
class and their values and writing a text file for each time the booking
information is changed.

2 questions:
1 - Does this sound like a good way of doing it?
2 - Is there any way of enumerating all of the properties & their values?

Thanks in advance,

Stu


Nov 21 '05 #3

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

Similar topics

21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
4
by: jbesr1230 | last post by:
Hello, How would I print out a listing of the queries that are in a database? I would like to have a spreadsheet style listing with the columns of: Query Name, Description, Modified Date, Created...
4
by: Jonny | last post by:
I'm sure this is easy and i'll kick myself for it. How would i go about listing all the machines on a domain? I want to display them in a list box. Thanks /Jonny
1
by: Jerry Negrelli | last post by:
Can anyone help translate this into C#??? It's supposed to list all subnets in all AD sites (see URL below). I placed it in a VB class library (one class with one "Function", WScript.Echo...
9
by: David A. Osborn | last post by:
I have a set of classes that each have an enumeration in them, and based on dynamic input I need to access a different enumeration. For example Three classes Class_A, Class_B, and Class_C that...
8
by: Lüpher Cypher | last post by:
Hi, Suppose we have a hierarchical class structure that looks something like this: Object | +-- Main | +-- Object1
2
by: usenet | last post by:
I am trying to collect a comprehensive listing of standard C++ exceptions. This is what I have got so far (by going through the standard). Kindly let me know if I missed anything. Thanks,...
4
by: John | last post by:
Hi Is there an easy or a built-in way to collect all properties of an object into a string variable for debugging purpose? I am looking for something similar to this; "Property1:...
5
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
Suppose I define a class with a number of variables defined as properties. Something like: class MyClass(object): def __init__(self): self.some_variable = 42 self._a = None self._b = "pi"
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.