33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 55
6+ using System . Collections . Frozen ;
7+
68namespace BootstrapBlazor . Server . Data ;
79
810/// <summary>
9- ///
11+ /// WebsiteOptions 网站配置类
1012/// </summary>
1113public class WebsiteOptions
1214{
@@ -102,12 +104,12 @@ public class WebsiteOptions
102104 /// <summary>
103105 /// 获得/设置 资源配置集合
104106 /// </summary>
105- public Dictionary < string , string ? > SourceCodes { get ; private set ; }
107+ public FrozenDictionary < string , string ? > SourceCodes { get ; private set ; }
106108
107109 /// <summary>
108110 /// 获得/设置 资源配置集合
109111 /// </summary>
110- public Dictionary < string , string ? > Videos { get ; private set ; }
112+ public FrozenDictionary < string , string ? > Videos { get ; private set ; }
111113
112114 /// <summary>
113115 /// 获得/设置 当前主题
@@ -127,23 +129,23 @@ public class WebsiteOptions
127129 /// <summary>
128130 /// 获得/设置 当前网站友联集合
129131 /// </summary>
130- public Dictionary < string , string ? > Links { get ; set ; }
132+ public FrozenDictionary < string , string ? > Links { get ; set ; }
131133
132134 /// <summary>
133135 /// 获得/设置 网站主题配置集合
134136 /// </summary>
135137 [ NotNull ]
136- public List < ThemeOption > ? Themes { get ; set ; }
138+ public HashSet < ThemeOption > ? Themes { get ; set ; }
137139
138140 /// <summary>
139141 /// 构造函数
140142 /// </summary>
141143 public WebsiteOptions ( )
142144 {
143145 var config = GetConfiguration ( "docs.json" ) ;
144- SourceCodes = config . GetSection ( "src" ) . GetChildren ( ) . Select ( c => new KeyValuePair < string , string ? > ( c . Key , c . Value ) ) . ToDictionary ( item => item . Key , item => item . Value ) ;
145- Videos = config . GetSection ( "video" ) . GetChildren ( ) . Select ( c => new KeyValuePair < string , string ? > ( c . Key , c . Value ) ) . ToDictionary ( item => item . Key , item => item . Value ) ;
146- Links = config . GetSection ( "link" ) . GetChildren ( ) . Select ( c => new KeyValuePair < string , string ? > ( c . Key , c . Value ) ) . ToDictionary ( item => item . Key , item => item . Value ) ;
146+ SourceCodes = config . GetSection ( "src" ) . GetChildren ( ) . Select ( c => new KeyValuePair < string , string ? > ( c . Key , c . Value ) ) . ToFrozenDictionary ( item => item . Key , item => item . Value ) ;
147+ Videos = config . GetSection ( "video" ) . GetChildren ( ) . Select ( c => new KeyValuePair < string , string ? > ( c . Key , c . Value ) ) . ToFrozenDictionary ( item => item . Key , item => item . Value ) ;
148+ Links = config . GetSection ( "link" ) . GetChildren ( ) . Select ( c => new KeyValuePair < string , string ? > ( c . Key , c . Value ) ) . ToFrozenDictionary ( item => item . Key , item => item . Value ) ;
147149
148150#if DEBUG
149151 IsDevelopment = true ;
0 commit comments