Dynamic public property generation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • funVB2005fun

    #1

    Dynamic public property generation


    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
    *************** *************** *************** *****
  • Cor Ligthert

    #2
    Re: Dynamic public property generation

    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


    Comment

    • funVB2005fun

      #3
      Re: Dynamic public property generation

      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.Enti ties.Users.User Profile


      Public Class GroUserProfile
      Inherits DotNetNuke.Enti ties.Users.User Profile



      *************** *************** *************** *************** ****
      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.Enti ties.Users.User Profile

      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" <notmyfirstname @planet.nl> wrote in
      news:u$715mjWFH A.612@TK2MSFTNG P12.phx.gbl:
      [color=blue]
      > 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
      >
      >[/color]

      Comment

      • funVB2005fun

        #4
        Re: Dynamic public property generation


        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.





        Dynamically executing code in .Net
        By Rick Strahl

        Last Update: September 8th, 2002






























        Comment

        • Cor Ligthert

          #5
          Re: Dynamic public property generation

          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


          Comment

          Working...