By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,579 Members | 1,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,579 IT Pros & Developers. It's quick & easy.

Dynamic public property generation

P: n/a

I am not quite sure what I am getting into but I would like to have a loop
that read from a flat file to create some public properties in a class. I
am going after this to try and create more general software that others
could benefit from vs hardcoding things that relate only to my processes.

example property that I would want to generate:
The idea would be to read from a file that "AGE" is needed and that it is
and Integer and then to create the property in a class. This is related to
DotNetNuke 3.x

I do know one method relates to having a class that manipulates the class
file that need to be dynamic... Any thoughts on this or successful
attempts?

*************************************************
Public Property Age() As Integer
Get
Return _Age
End Get
Set(ByVal Value As Integer)
_Age = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
**************************************************
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
FunVB

Are you talking about a schoolclass, or about the class as we know it, what
is a very solid base for all OOP objects?

Cor
Nov 21 '05 #2

P: n/a
Could you please expand on the schoolclass topic. I am not familiar with
that but am open to all possibilities.
If you are talking specifically about DNN I have a new class that is
inheriting from DotNetNuke.Entities.Users.UserProfile
Public Class GroUserProfile
Inherits DotNetNuke.Entities.Users.UserProfile

************************************************** **************
Full Code of class I want to auto generate properties from a flat
file. specifically so it is possible for an end user to add user
attributes without haveing to recompile and edit several class files.
************************************************** **************
Namespace GRO.Users

Public Class GroUserProfile
Inherits DotNetNuke.Entities.Users.UserProfile

Private _GroLocation As String
Private _Age As Integer
Private _UserClasses As String
Private _Gender As String
Private _Registrar As String
Private _Title As String
Private _Organization As String
Public Sub New()
End Sub

Public Property GroLocation() As String
Get
Return _GroLocation
End Get
Set(ByVal Value As String)
_GroLocation = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
Public Property Age() As Integer
Get
Return _Age
End Get
Set(ByVal Value As Integer)
_Age = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
Public Property UserClasses() As String
Get
Return _UserClasses
End Get
Set(ByVal Value As String)
_UserClasses = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
Public Property Gender() As String
Get
Return _Gender
End Get
Set(ByVal Value As String)
_Gender = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
Public Property Registrar() As String
Get
Return _Registrar
End Get
Set(ByVal Value As String)
_Registrar = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
Public Property Title() As String
Get
Return _Title
End Get
Set(ByVal Value As String)
_Title = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
Public Property Organization() As String
Get
Return _Organization
End Get
Set(ByVal Value As String)
_Organization = Value
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
End Class
End Namespace


"Cor Ligthert" <no************@planet.nl> wrote in
news:u$*************@TK2MSFTNGP12.phx.gbl:
FunVB

Are you talking about a schoolclass, or about the class as we know it,
what is a very solid base for all OOP objects?

Cor


Nov 21 '05 #3

P: n/a

Ok this is a website for dynamic execution of code in .NET that I am
working with atm.

This is a great start but having some problems with a web project vs
windows application.
http://www.west-wind.com/presentatio...ynamiccode.htm
Dynamically executing code in .Net
By Rick Strahl
http://www.west-wind.com/
Last Update: September 8th, 2002










Nov 21 '05 #4

P: n/a
Fun,

You are not the first one who is busy with this. You can be the first one
who realise this correct from a point of the end-users view.

What you try to do endless done. To call some which still exist: SQL,
JavaScript, VBScript, the first generations FoxPro's, MS-Access, Excel,
hundreds or thousands or probably even more don't exist anymore.

I do not have the idea that it is handy for somebody who knows real tools,
while the end-user don't use them. There are complete developers groups now
around those so called easy solutions/languages.

You can try to find that never really good functioning developed wheel.
However I think that it is than a long lonely route to go.

However just my thought,

Cor
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.