@@ -4,29 +4,29 @@ public class OptionSettingViewModel : MyReactiveObject
44{
55 #region Core
66
7- [ Reactive ] public int localPort { get ; set ; }
7+ [ Reactive ] public int LocalPort { get ; set ; }
88 [ Reactive ] public bool SecondLocalPortEnabled { get ; set ; }
9- [ Reactive ] public bool udpEnabled { get ; set ; }
10- [ Reactive ] public bool sniffingEnabled { get ; set ; }
11- public IList < string > destOverride { get ; set ; }
12- [ Reactive ] public bool routeOnly { get ; set ; }
13- [ Reactive ] public bool allowLANConn { get ; set ; }
14- [ Reactive ] public bool newPort4LAN { get ; set ; }
15- [ Reactive ] public string user { get ; set ; }
16- [ Reactive ] public string pass { get ; set ; }
17- [ Reactive ] public bool muxEnabled { get ; set ; }
18- [ Reactive ] public bool logEnabled { get ; set ; }
19- [ Reactive ] public string loglevel { get ; set ; }
20- [ Reactive ] public bool defAllowInsecure { get ; set ; }
21- [ Reactive ] public string defFingerprint { get ; set ; }
22- [ Reactive ] public string defUserAgent { get ; set ; }
23- [ Reactive ] public string sendThrough { get ; set ; }
24- [ Reactive ] public string bindInterface { get ; set ; }
25- [ Reactive ] public string mux4SboxProtocol { get ; set ; }
26- [ Reactive ] public bool enableCacheFile4Sbox { get ; set ; }
27- [ Reactive ] public int ? hyUpMbps { get ; set ; }
28- [ Reactive ] public int ? hyDownMbps { get ; set ; }
29- [ Reactive ] public bool enableFragment { get ; set ; }
9+ [ Reactive ] public bool UdpEnabled { get ; set ; }
10+ [ Reactive ] public bool SniffingEnabled { get ; set ; }
11+ public IList < string > DestOverride { get ; set ; }
12+ [ Reactive ] public bool RouteOnly { get ; set ; }
13+ [ Reactive ] public bool AllowLANConn { get ; set ; }
14+ [ Reactive ] public bool NewPort4LAN { get ; set ; }
15+ [ Reactive ] public string User { get ; set ; }
16+ [ Reactive ] public string Pass { get ; set ; }
17+ [ Reactive ] public bool MuxEnabled { get ; set ; }
18+ [ Reactive ] public bool LogEnabled { get ; set ; }
19+ [ Reactive ] public string Loglevel { get ; set ; }
20+ [ Reactive ] public bool DefAllowInsecure { get ; set ; }
21+ [ Reactive ] public string DefFingerprint { get ; set ; }
22+ [ Reactive ] public string DefUserAgent { get ; set ; }
23+ [ Reactive ] public string SendThrough { get ; set ; }
24+ [ Reactive ] public string BindInterface { get ; set ; }
25+ [ Reactive ] public string Mux4SboxProtocol { get ; set ; }
26+ [ Reactive ] public bool EnableCacheFile4Sbox { get ; set ; }
27+ [ Reactive ] public int ? HyUpMbps { get ; set ; }
28+ [ Reactive ] public int ? HyDownMbps { get ; set ; }
29+ [ Reactive ] public bool EnableFragment { get ; set ; }
3030
3131 #endregion Core
3232
@@ -83,9 +83,9 @@ public class OptionSettingViewModel : MyReactiveObject
8383
8484 #region System proxy
8585
86- [ Reactive ] public bool notProxyLocalAddress { get ; set ; }
87- [ Reactive ] public string systemProxyAdvancedProtocol { get ; set ; }
88- [ Reactive ] public string systemProxyExceptions { get ; set ; }
86+ [ Reactive ] public bool NotProxyLocalAddress { get ; set ; }
87+ [ Reactive ] public string SystemProxyAdvancedProtocol { get ; set ; }
88+ [ Reactive ] public string SystemProxyExceptions { get ; set ; }
8989 [ Reactive ] public string CustomSystemProxyPacPath { get ; set ; }
9090 [ Reactive ] public string CustomSystemProxyScriptPath { get ; set ; }
9191
@@ -142,28 +142,28 @@ private async Task Init()
142142 #region Core
143143
144144 var inbound = _config . Inbound . First ( ) ;
145- localPort = inbound . LocalPort ;
145+ LocalPort = inbound . LocalPort ;
146146 SecondLocalPortEnabled = inbound . SecondLocalPortEnabled ;
147- udpEnabled = inbound . UdpEnabled ;
148- sniffingEnabled = inbound . SniffingEnabled ;
149- routeOnly = inbound . RouteOnly ;
150- allowLANConn = inbound . AllowLANConn ;
151- newPort4LAN = inbound . NewPort4LAN ;
152- user = inbound . User ;
153- pass = inbound . Pass ;
154- muxEnabled = _config . CoreBasicItem . MuxEnabled ;
155- logEnabled = _config . CoreBasicItem . LogEnabled ;
156- loglevel = _config . CoreBasicItem . Loglevel ;
157- defAllowInsecure = _config . CoreBasicItem . DefAllowInsecure ;
158- defFingerprint = _config . CoreBasicItem . DefFingerprint ;
159- defUserAgent = _config . CoreBasicItem . DefUserAgent ;
160- sendThrough = _config . CoreBasicItem . SendThrough ?? string . Empty ;
161- bindInterface = _config . CoreBasicItem . BindInterface ?? string . Empty ;
162- mux4SboxProtocol = _config . Mux4SboxItem . Protocol ;
163- enableCacheFile4Sbox = _config . CoreBasicItem . EnableCacheFile4Sbox ;
164- hyUpMbps = _config . HysteriaItem . UpMbps ;
165- hyDownMbps = _config . HysteriaItem . DownMbps ;
166- enableFragment = _config . CoreBasicItem . EnableFragment ;
147+ UdpEnabled = inbound . UdpEnabled ;
148+ SniffingEnabled = inbound . SniffingEnabled ;
149+ RouteOnly = inbound . RouteOnly ;
150+ AllowLANConn = inbound . AllowLANConn ;
151+ NewPort4LAN = inbound . NewPort4LAN ;
152+ User = inbound . User ;
153+ Pass = inbound . Pass ;
154+ MuxEnabled = _config . CoreBasicItem . MuxEnabled ;
155+ LogEnabled = _config . CoreBasicItem . LogEnabled ;
156+ Loglevel = _config . CoreBasicItem . Loglevel ;
157+ DefAllowInsecure = _config . CoreBasicItem . DefAllowInsecure ;
158+ DefFingerprint = _config . CoreBasicItem . DefFingerprint ;
159+ DefUserAgent = _config . CoreBasicItem . DefUserAgent ;
160+ SendThrough = _config . CoreBasicItem . SendThrough ?? string . Empty ;
161+ BindInterface = _config . CoreBasicItem . BindInterface ?? string . Empty ;
162+ Mux4SboxProtocol = _config . Mux4SboxItem . Protocol ;
163+ EnableCacheFile4Sbox = _config . CoreBasicItem . EnableCacheFile4Sbox ;
164+ HyUpMbps = _config . HysteriaItem . UpMbps ;
165+ HyDownMbps = _config . HysteriaItem . DownMbps ;
166+ EnableFragment = _config . CoreBasicItem . EnableFragment ;
167167
168168 #endregion Core
169169
@@ -211,9 +211,9 @@ private async Task Init()
211211
212212 #region System proxy
213213
214- notProxyLocalAddress = _config . SystemProxyItem . NotProxyLocalAddress ;
215- systemProxyAdvancedProtocol = _config . SystemProxyItem . SystemProxyAdvancedProtocol ;
216- systemProxyExceptions = _config . SystemProxyItem . SystemProxyExceptions ;
214+ NotProxyLocalAddress = _config . SystemProxyItem . NotProxyLocalAddress ;
215+ SystemProxyAdvancedProtocol = _config . SystemProxyItem . SystemProxyAdvancedProtocol ;
216+ SystemProxyExceptions = _config . SystemProxyItem . SystemProxyExceptions ;
217217 CustomSystemProxyPacPath = _config . SystemProxyItem . CustomSystemProxyPacPath ;
218218 CustomSystemProxyScriptPath = _config . SystemProxyItem . CustomSystemProxyScriptPath ;
219219
@@ -297,13 +297,13 @@ private async Task InitCoreType()
297297
298298 private async Task SaveSettingAsync ( )
299299 {
300- if ( localPort . ToString ( ) . IsNullOrEmpty ( ) || ! Utils . IsNumeric ( localPort . ToString ( ) )
301- || localPort <= 0 || localPort >= Global . MaxPort )
300+ if ( LocalPort . ToString ( ) . IsNullOrEmpty ( ) || ! Utils . IsNumeric ( LocalPort . ToString ( ) )
301+ || LocalPort <= 0 || LocalPort >= Global . MaxPort )
302302 {
303303 NoticeManager . Instance . Enqueue ( ResUI . FillLocalListeningPort ) ;
304304 return ;
305305 }
306- var sendThroughValue = sendThrough . TrimEx ( ) ;
306+ var sendThroughValue = SendThrough . TrimEx ( ) ;
307307 if ( sendThroughValue . IsNotEmpty ( ) && ! Utils . IsIpv4 ( sendThroughValue ) )
308308 {
309309 NoticeManager . Instance . Enqueue ( ResUI . FillCorrectSendThroughIPv4 ) ;
@@ -328,33 +328,33 @@ private async Task SaveSettingAsync()
328328 //}
329329
330330 //Core
331- _config . Inbound . First ( ) . LocalPort = localPort ;
331+ _config . Inbound . First ( ) . LocalPort = LocalPort ;
332332 _config . Inbound . First ( ) . SecondLocalPortEnabled = SecondLocalPortEnabled ;
333- _config . Inbound . First ( ) . UdpEnabled = udpEnabled ;
334- _config . Inbound . First ( ) . SniffingEnabled = sniffingEnabled ;
335- _config . Inbound . First ( ) . DestOverride = destOverride ? . ToList ( ) ;
336- _config . Inbound . First ( ) . RouteOnly = routeOnly ;
337- _config . Inbound . First ( ) . AllowLANConn = allowLANConn ;
338- _config . Inbound . First ( ) . NewPort4LAN = newPort4LAN ;
339- _config . Inbound . First ( ) . User = user ;
340- _config . Inbound . First ( ) . Pass = pass ;
333+ _config . Inbound . First ( ) . UdpEnabled = UdpEnabled ;
334+ _config . Inbound . First ( ) . SniffingEnabled = SniffingEnabled ;
335+ _config . Inbound . First ( ) . DestOverride = DestOverride ? . ToList ( ) ;
336+ _config . Inbound . First ( ) . RouteOnly = RouteOnly ;
337+ _config . Inbound . First ( ) . AllowLANConn = AllowLANConn ;
338+ _config . Inbound . First ( ) . NewPort4LAN = NewPort4LAN ;
339+ _config . Inbound . First ( ) . User = User ;
340+ _config . Inbound . First ( ) . Pass = Pass ;
341341 if ( _config . Inbound . Count > 1 )
342342 {
343343 _config . Inbound . RemoveAt ( 1 ) ;
344344 }
345- _config . CoreBasicItem . LogEnabled = logEnabled ;
346- _config . CoreBasicItem . Loglevel = loglevel ;
347- _config . CoreBasicItem . MuxEnabled = muxEnabled ;
348- _config . CoreBasicItem . DefAllowInsecure = defAllowInsecure ;
349- _config . CoreBasicItem . DefFingerprint = defFingerprint ;
350- _config . CoreBasicItem . DefUserAgent = defUserAgent ;
351- _config . CoreBasicItem . SendThrough = sendThrough . TrimEx ( ) ;
352- _config . CoreBasicItem . BindInterface = bindInterface . TrimEx ( ) ;
353- _config . Mux4SboxItem . Protocol = mux4SboxProtocol ;
354- _config . CoreBasicItem . EnableCacheFile4Sbox = enableCacheFile4Sbox ;
355- _config . HysteriaItem . UpMbps = hyUpMbps ?? 0 ;
356- _config . HysteriaItem . DownMbps = hyDownMbps ?? 0 ;
357- _config . CoreBasicItem . EnableFragment = enableFragment ;
345+ _config . CoreBasicItem . LogEnabled = LogEnabled ;
346+ _config . CoreBasicItem . Loglevel = Loglevel ;
347+ _config . CoreBasicItem . MuxEnabled = MuxEnabled ;
348+ _config . CoreBasicItem . DefAllowInsecure = DefAllowInsecure ;
349+ _config . CoreBasicItem . DefFingerprint = DefFingerprint ;
350+ _config . CoreBasicItem . DefUserAgent = DefUserAgent ;
351+ _config . CoreBasicItem . SendThrough = SendThrough . TrimEx ( ) ;
352+ _config . CoreBasicItem . BindInterface = BindInterface . TrimEx ( ) ;
353+ _config . Mux4SboxItem . Protocol = Mux4SboxProtocol ;
354+ _config . CoreBasicItem . EnableCacheFile4Sbox = EnableCacheFile4Sbox ;
355+ _config . HysteriaItem . UpMbps = HyUpMbps ?? 0 ;
356+ _config . HysteriaItem . DownMbps = HyDownMbps ?? 0 ;
357+ _config . CoreBasicItem . EnableFragment = EnableFragment ;
358358
359359 _config . GuiItem . AutoRun = AutoRun ;
360360 _config . GuiItem . EnableStatistics = EnableStatistics ;
@@ -383,9 +383,9 @@ private async Task SaveSettingAsync()
383383 _config . SpeedTestItem . IPAPIUrl = IPAPIUrl ;
384384
385385 //systemProxy
386- _config . SystemProxyItem . SystemProxyExceptions = systemProxyExceptions ;
387- _config . SystemProxyItem . NotProxyLocalAddress = notProxyLocalAddress ;
388- _config . SystemProxyItem . SystemProxyAdvancedProtocol = systemProxyAdvancedProtocol ;
386+ _config . SystemProxyItem . SystemProxyExceptions = SystemProxyExceptions ;
387+ _config . SystemProxyItem . NotProxyLocalAddress = NotProxyLocalAddress ;
388+ _config . SystemProxyItem . SystemProxyAdvancedProtocol = SystemProxyAdvancedProtocol ;
389389 _config . SystemProxyItem . CustomSystemProxyPacPath = CustomSystemProxyPacPath ;
390390 _config . SystemProxyItem . CustomSystemProxyScriptPath = CustomSystemProxyScriptPath ;
391391
0 commit comments