Click here to Skip to main content
15,885,878 members
Articles / Database Development / SQL Server

Create a Custom Settings Provider to Share Settings Between Applications

Rate me:
Please Sign up or sign in to vote.
3.50/5 (6 votes)
13 Dec 2010CPOL9 min read 52.9K   1.1K   36  
This article describes how to leverage .NET Application Settings architecture to give distributed applications access to shared settings.
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:2.0.50727.3603
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On



<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(),  _
 Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")>  _
Partial Public NotInheritable Class NetrudderSettings
    Inherits Global.System.Configuration.ApplicationSettingsBase
    
    Private Shared defaultInstance As NetrudderSettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New NetrudderSettings),NetrudderSettings)
    
    Public Shared ReadOnly Property [Default]() As NetrudderSettings
        Get
            Return defaultInstance
        End Get
    End Property
    
    <Global.System.Configuration.ApplicationScopedSettingAttribute(),  _
     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     Global.System.Configuration.DefaultSettingValueAttribute("NetRudder")>  _
    Public ReadOnly Property Copyright() As String
        Get
            Return CType(Me("Copyright"),String)
        End Get
    End Property
    
    <Global.System.Configuration.ApplicationScopedSettingAttribute(),  _
     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     Global.System.Configuration.DefaultSettingValueAttribute("True")>  _
    Public ReadOnly Property Active() As Boolean
        Get
            Return CType(Me("Active"),Boolean)
        End Get
    End Property    
    
    <Global.System.Configuration.ApplicationScopedSettingAttribute(),  _
     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     Global.System.Configuration.DefaultSettingValueAttribute("11.624495")>  _
    Public ReadOnly Property Lattitude() As Double
        Get
            Return CType(Me("Lattitude"),Double)
        End Get
    End Property
    
    <Global.System.Configuration.ApplicationScopedSettingAttribute(),  _
     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     Global.System.Configuration.DefaultSettingValueAttribute("165.552378")>  _
    Public ReadOnly Property Longitude() As Double
        Get
            Return CType(Me("Longitude"),Double)
        End Get
    End Property

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions