Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>10.0.8-beta05</Version>
<Version>10.0.8-beta06</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

if (OnClickTitleBarCallback != null)
{
OnClickTitleBarCallback = null;
}

DockView.RemoveComponentState(Key);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace BootstrapBlazor.Components;
/// <para lang="zh">DockView 标题栏组件</para>
/// <para lang="en">DockView title bar component</para>
/// </summary>
public partial class DockViewTitleBar
public partial class DockViewTitleBar : IAsyncDisposable
{
/// <summary>
/// <para lang="zh">获得/设置 标题前置图标点击回调方法,默认为 null</para>
Expand Down Expand Up @@ -40,4 +40,29 @@ private async Task OnClickBar()
await OnClickBarCallback();
}
}

/// <summary>
/// <inheritdoc/>
/// </summary>
/// <param name="disposing"></param>
/// <returns></returns>
protected virtual ValueTask DisposeAsync(bool disposing)
{
if (disposing)
{
OnClickBarCallback = null;
}

return ValueTask.CompletedTask;
}

/// <summary>
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
public async ValueTask DisposeAsync()
{
await DisposeAsync(true);
GC.SuppressFinalize(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace BootstrapBlazor.Components;
/// <para lang="zh">DockViewV2 组件</para>
/// <para lang="en">DockViewV2 component</para>
/// </summary>
public partial class DockViewV2 : IDisposable
public partial class DockViewV2
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing IDisposable from the public DockViewV2 type is a breaking API change for any consumers that were relying on DockViewV2 being disposable (e.g., storing it as IDisposable). If the goal is to switch to the base class async dispose pattern, consider preserving compatibility by keeping IDisposable on the public surface (or providing an explicit IDisposable.Dispose that forwards to the async dispose path), or document this as an intentional breaking change for the beta bump.

Copilot uses AI. Check for mistakes.
{
/// <summary>
/// <para lang="zh">获得/设置 DockView 名称,默认为 null,用于本地存储标识</para>
Expand Down Expand Up @@ -413,20 +413,18 @@ internal void UpdateComponentState(string? key, bool visible, bool? isLock)
return state;
}

private void Dispose(bool disposing)
/// <summary>
/// <inheritdoc/>
/// </summary>
/// <param name="disposing"></param>
/// <returns></returns>
protected override ValueTask DisposeAsync(bool disposing)
{
if (disposing)
{
ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync;
}
}

/// <summary>
/// <inheritdoc/>
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
return base.DisposeAsync(disposing);
Comment on lines 424 to +428
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DisposeAsync override order is inconsistent with other BootstrapModuleComponentBase components in this repo (they typically await base.DisposeAsync(disposing) first, then run component-specific cleanup; e.g. BootstrapBlazor.Term/Components/Term.razor.cs:226-235, BootstrapBlazor.WinBox/WinBox.razor.cs:249-257). Consider aligning to that pattern (and making this method async if needed) to match the established convention and avoid surprises if the base dispose logic depends on running before derived cleanup.

Copilot uses AI. Check for mistakes.
}
}
Loading