reflection? Could i get each assemby and then do a For Each spv As SettingsPropertyValue In My.Settings.PropertyValues or maybe I code into each assembly a settings controller class :
Public class SettingsControl
Public shared function GetSettings as System.Configuration.SettingsPropertyValueCollection return My.Settings.PropertyValues end function
public shared sub SetSettings(settings asSystem.Configuration.SettingsPropertyValueCollection) 'Im getting a bit frightened now 'System.Configuration.SettingsPropertyValueCollection implements IEnumerable - not IEnumerable( of T) Dim incomingSettings As New List(Of SettingsPropertyValue) For Each spv As SettingsPropertyValue In settings incomingSettings.Add(spv) Next
Dim MySettings As New List(Of SettingsPropertyValue) For Each spv As SettingsPropertyValue In My.Settings.PropertyValues MySettings.Add(spv) Next
Dim commonSettings = From sNew In inComingSettings, sOld In MySettings _ Where sOld.Property.PropertyType IssNew .Property.PropertyType _ And sOld.Property.Name = sNew.Property.Name _ Select sOld, sNew
For Each pair In commonSettings pair.sOld.PropertyValue = pair.sNew.PropertyValue Next My.Settings.Save()
end sub end class
in th main I could then reflect through each assembly and see if theres aSettingsControlClass
assemby1.GetSettings inherit treeNode to have an AddSettings(settings asSystem.Configuration.SettingsPropertyValueCollection) or propertygridOnTabbedPage1.DOsomethingy =assemby1.SettingsControlClass.GetSettings ??
|