⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 registrysettingsprovider.vb

📁 讲解visual studio的应用
💻 VB
字号:
Imports System.Configuration

Public Class WebServiceSettingsProvider
    Inherits SettingsProvider

    Private _appName As String = "Settings"
    Public Overrides Property ApplicationName() As String
        Get
            Return Me._appName
        End Get
        Set(ByVal value As String)
            Me._appName = value
        End Set
    End Property


    Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)
        MyBase.Initialize(Me.ApplicationName, config)
    End Sub



    ''' <summary>
    ''' Get the settings for this application 
    ''' </summary>
    Public Overrides Function GetPropertyValues( _
                                  ByVal context As SettingsContext, _
                                  ByVal collection As SettingsPropertyCollection) _
                                        As SettingsPropertyValueCollection
        Dim values As New SettingsPropertyValueCollection
        For Each settingProperty As SettingsProperty In collection
            Dim settingValue As New SettingsPropertyValue(settingProperty)
            settingValue.IsDirty = False

            settingValue.SerializedValue = _
                     My.WebServices.Settings.GetPropertyValue(settingProperty.Name)
            values.Add(settingValue)
        Next
        Return values
    End Function

    ''' <summary>
    ''' Update the settings that have changed.  
    ''' </summary>
    Public Overrides Sub SetPropertyValues( _
                             ByVal context As SettingsContext, _
                             ByVal collection As SettingsPropertyValueCollection)
        For Each propertyValue As SettingsPropertyValue In collection
            My.WebServices.Settings.SetPropertyValue( _
                                        propertyValue.Name, _
                                        propertyValue.SerializedValue)
        Next
    End Sub




End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -