473,405 Members | 2,300 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,405 software developers and data experts.

create class with dynamic properties

I found it seems there is a way to create a class with dynamic properties, I
don't really need define each property?

In ASP.NET, Profile is created with all profile items in web.config as its
properties, I found it has code like this:

public static SettingsPropertyCollection Properties
{
get
{
ProfileBase.InitializeStatic();
return ProfileBase.s_Properties;
}
}

I an not quite sure how it works, but in most case, I would like properties
of some of my class are controlled by code, that means I don't need define
those properties before compilation, could anyone tell me how I do that?

thanks!
Jul 20 '06 #1
1 2448

"davidw" <da****@affinisys.comwrote in message
news:e6**************@TK2MSFTNGP05.phx.gbl...
>I found it seems there is a way to create a class with dynamic properties,
I
don't really need define each property?

In ASP.NET, Profile is created with all profile items in web.config as its
properties, I found it has code like this:

public static SettingsPropertyCollection Properties
{
get
{
ProfileBase.InitializeStatic();
return ProfileBase.s_Properties;
}
}

I an not quite sure how it works, but in most case, I would like
properties
of some of my class are controlled by code, that means I don't need define
those properties before compilation, could anyone tell me how I do that?
I think ASP.NET requires web.config to be available during compilation.

However a Dictionary object will give you just about the effect you are
looking for.
>
thanks!


Jul 20 '06 #2

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

Similar topics

2
by: Leon Jollans | last post by:
Hi all Is there a way to catch all property requests and resolve at runtime internally within the class? I ask because I'm looking into creating a dynamic CrystalReport web service, and all the...
2
by: listerofsmeg | last post by:
Newbie here. I want to use a .config file with my simple console app, but no matter what I do I cannot get the "dynamic" rollout in my properties window. In the end I gave up and coded the...
3
by: Guy Harwood | last post by:
Hi, I have designed a textbox that inherits from the System.Windows.Forms.Textbox control. when the control is readonly the back color changes to a light blue to indicate that it is frozen. ...
4
by: Richard Abraham | last post by:
I have created a new class ServiceTimer based upon the .NET System.Timers.Timer class. This has a new property CollectionIntervalMinutes which I expected to be added to the 'Behavior' section of the...
1
by: jm | last post by:
I am using (trying) dynamic properties to store a database connection. However, I don't have a connection object on the form. I just do a OdbcConnection in my code. So I can't use the VS IDE to...
3
by: cwertman | last post by:
I have a question regarding dynamic properties. I have an Object say Account --Id --Prefix --Fname --Lname --Suffix
0
by: vnu | last post by:
Hi, Hi, I am working in .net emvironment using vs2005 and vb.net as the language. In one of my project, I need to display the properties of a com object which has dynamic properties(late bind...
0
by: Rahul | last post by:
Friends, My Question is related to the DTS Package (Dynamic Properties Task). I have a DTS package, In this, I transfer data from a database to another database. Senario -: (DB1.tbl1...
5
by: Sergio Montero | last post by:
I have a MustInherits Base class that implements a custom IDataLayer interfase. IDataLayer expose CRUD methods. Base class constructor requires two parameters: ConnectionString TableName ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.