@@ -28,7 +28,7 @@ public class UserAppSettings : BaseViewModel
2828
2929 private SortableObservableCollection < ApplicationProfileAssignment > _applicationProfileAssignments ;
3030 private DispatchingObservableCollection < Profile > _applicationProfiles ;
31- private DispatchingObservableCollection < Display > _monitors ;
31+ private DispatchingObservableCollection < Display > _displays ;
3232
3333
3434 [ JsonProperty ]
@@ -64,7 +64,7 @@ public class UserAppSettings : BaseViewModel
6464
6565
6666 [ JsonProperty ]
67- public DispatchingObservableCollection < Display > Displays { get => _monitors ; set { _monitors = value ; OnPropertyChanged ( ) ; } }
67+ public DispatchingObservableCollection < Display > Displays { get => _displays ; set { _displays = value ; OnPropertyChanged ( ) ; } }
6868
6969
7070 public UserAppSettings ( )
@@ -84,6 +84,7 @@ public static UserAppSettings ReadSettings(string path)
8484 try
8585 {
8686 string serializedJson = File . ReadAllText ( path ) ;
87+ serializedJson = UpgradeJson ( serializedJson ) ;
8788 settings = ( UserAppSettings ) JsonConvert . DeserializeObject < UserAppSettings > ( serializedJson , new JsonSerializerSettings
8889 {
8990 TypeNameHandling = TypeNameHandling . Objects ,
@@ -108,6 +109,13 @@ public static UserAppSettings ReadSettings(string path)
108109 return settings ;
109110 }
110111
112+ private static string UpgradeJson ( string serializedJson )
113+ {
114+ serializedJson = serializedJson . Replace ( "\" $type\" : \" AutoHDR.Displays.Display, AutoHDR\" " , "\" $type\" : \" AutoHDR.Displays.Display, AutoHDR.Displays\" " ) ;
115+ serializedJson = serializedJson . Replace ( "\" Monitors\" : [" , "\" Displays\" : [" ) ;
116+ return serializedJson ;
117+ }
118+
111119 private static UserAppSettings TryReadXML ( string path )
112120 {
113121 UserAppSettings settings = null ;
0 commit comments