File tree Expand file tree Collapse file tree
src/BootstrapBlazor/Components/Dropdown Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the Apache 2.0 License
3+ // See the LICENSE file in the project root for more information.
4+ // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
5+
6+ using Microsoft . AspNetCore . Components . Rendering ;
7+
8+ namespace BootstrapBlazor . Components ;
9+
10+ /// <summary>
11+ /// DropdownDivider 组件
12+ /// </summary>
13+ public class DropdownDivider : Divider , IDropdownItem , IDisposable
14+ {
15+ [ CascadingParameter ]
16+ [ NotNull ]
17+ private List < IDropdownItem > ? Items { get ; set ; }
18+
19+ /// <summary>
20+ /// <inheritdoc/>
21+ /// </summary>
22+ protected override void OnInitialized ( )
23+ {
24+ base . OnInitialized ( ) ;
25+
26+ Items . Add ( this ) ;
27+ }
28+
29+ /// <summary>
30+ /// <inheritdoc/>
31+ /// </summary>
32+ /// <param name="builder"></param>
33+ protected override void BuildRenderTree ( RenderTreeBuilder builder ) { }
34+
35+ private bool disposedValue ;
36+
37+ /// <summary>
38+ /// 释放资源方法
39+ /// </summary>
40+ /// <param name="disposing"></param>
41+ protected virtual void Dispose ( bool disposing )
42+ {
43+ if ( ! disposedValue )
44+ {
45+ if ( disposing )
46+ {
47+ Items . Remove ( this ) ;
48+ }
49+ disposedValue = true ;
50+ }
51+ }
52+
53+ /// <summary>
54+ /// <inheritdoc/>
55+ /// </summary>
56+ public void Dispose ( )
57+ {
58+ Dispose ( true ) ;
59+ GC . SuppressFinalize ( this ) ;
60+ }
61+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments