Results 1 to 7 of 7

Thread: Replace a Module with a Class and Shared Member Question

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Location
    Three Rivers, MI
    Posts
    354

    Replace a Module with a Class and Shared Member Question

    I want to replace the Public Declarations that I currently store in a Module with a Class.

    Currently in my Module I have a declaration like this:
    Code:
    Public SetPath As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    How do I get the same functionality from a Class?

    Code:
    Public Class Audits
    
        Private _SetPath As String
        Public Property SetPath() As String
            Get
                Return _SetPath
            End Get
            Set(ByVal value As String)
                _SetPath = value
            End Set
        End Property
    
    End Class
    I know I can reference the SetPath in code by doing a Dim aud as New Audit so my question is this. Where is the correct place to put the

    = My.Computer.FileSystem.SpecialDirectories.MyDocuments

    And is this an good example of a member that should be shared? If so does both the Private and the Public need to be shared. I just started using Refactor Pro and it almost always is recommending that I make all members shared. Is there ever a good reason not to do so?
    Last edited by BukHix; Mar 17th, 2010 at 11:10 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width