File tree Expand file tree Collapse file tree
Components/BaseComponents Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,11 +80,13 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
8080 protected virtual void OnLoadJSModule ( )
8181 {
8282 var type = this . GetType ( ) ;
83- if ( CacheManager . GetAttribute < JSModuleNotInheritedAttribute > ( type ) == null )
83+ var inherited = type . GetCustomAttribute < JSModuleNotInheritedAttribute > ( ) == null ;
84+ if ( inherited )
8485 {
85- var attr = CacheManager . GetAttribute < JSModuleAutoLoaderAttribute > ( type ) ;
86- if ( attr != null )
86+ var attributes = type . GetCustomAttributes < JSModuleAutoLoaderAttribute > ( ) ;
87+ if ( attributes . Any ( ) )
8788 {
89+ var attr = attributes . First ( ) ;
8890 AutoInvokeDispose = attr . AutoInvokeDispose ;
8991 AutoInvokeInit = attr . AutoInvokeInit ;
9092
Original file line number Diff line number Diff line change @@ -216,22 +216,6 @@ private List<ICacheEntry> GetAllValues(MemoryCache cache)
216216 }
217217#endif
218218
219- #region Attribute
220- /// <summary>
221- /// 获得类型特性标签方法
222- /// </summary>
223- /// <param name="type"></param>
224- /// <returns></returns>
225- public static Attr ? GetAttribute < Attr > ( Type type ) where Attr : Attribute
226- {
227- return Instance . GetOrCreate ( ( type , typeof ( Attr ) ) , _ =>
228- {
229- return type . GetCustomAttribute < Attr > ( ) ;
230- } ) ;
231- }
232-
233- #endregion
234-
235219 #region Assembly
236220 /// <summary>
237221 /// 获得唯一类型名称方法
You can’t perform that action at this time.
0 commit comments