My.Settings Thoughts
- From: Mike <unknown@xxxxxxxxxx>
- Date: Sun, 07 Jun 2009 01:31:56 -0400
Mike wrote:
In other words, I thought "My" with its nested objects:
My.Application
My.Computer
My.Settings
My.User
was a GLOBAL shared memory map that allowed the EXE and her .NET dlls to shared this "namespace"
At this point, I get the idea that it might be sharing, but there are other things you need to prepare (security wise) to allow it to happen. But for the settings, it uses the same file, but the sections are different.
There are probably all kinds of implementations ideas going on here, but the purpose of single sourcing your code, I see some architecture notes here that is helpful:
Application Settings Architecture
http://msdn.microsoft.com/en-us/library/8eyb2ct1.aspx
I added the example code into my DLL class:
Public Class MyUserSettings
Inherits ApplicationSettingsBase
<UserScopedSetting()> _
<DefaultSettingValue("True")> _
Public Property UseAutoLogin() As Boolean
Get
return Me("UseAutoLogin")
End Get
Set(ByVal value As Boolean)
Me("UseAutoLogin") = value
End Set
End Property
End Class
And now I can use this a common class in the process itself. I am currently reading the section on "Settings Persistence" regarding the SettingsProvider.
Note: I already have a working solution so all this is more exploring whats there. For example, I had manually add properties to set/get the form fields but now I see it was already provided via:
Property Binding
To provide access to the EXE, I had created Get/Set properties (like above) but I did that in the Form partial class. With Property Binding I can now remove this redundant code. But I see this does not expose the property to the EXE so I think I prefer to keep the properties I added but this time add them to an inherited ApplicationSettingBase class so I can get access other class features, like Save() which was also manually added to the form partial class.
Ideally, what would useful and I believe a natural logic and declarative (layman coding) for RAD developers is extension to the My.Application object like
My.Application.Settings
That way it can be used by the application DLLs.
Anyway.... <g>
.
- Follow-Ups:
- Re: My.Settings Thoughts
- From: James Hahn
- Re: My.Settings Thoughts
- References:
- My.Settings Questions
- From: Mike
- Re: My.Settings Questions
- From: Cor Ligthert[MVP]
- Re: My.Settings Questions
- From: James Hahn
- Re: My.Settings Questions
- From: Cor Ligthert[MVP]
- Re: My.Settings Questions
- From: James Hahn
- Re: My.Settings Questions
- From: Cor Ligthert[MVP]
- Re: My.Settings Questions
- From: James Hahn
- Re: My.Settings Questions
- From: Mike
- My.Settings Questions
- Prev by Date: Re: exe running from unc
- Next by Date: Re: Screen Resolution
- Previous by thread: Re: My.Settings Questions
- Next by thread: Re: My.Settings Thoughts
- Index(es):
Relevant Pages
|
Loading