Files
AI-Studio/app/MindWork AI Studio/Dialogs/UpdateDialog.razor.cs
T

30 lines
973 B
C#
Raw Normal View History

2024-06-30 15:26:28 +02:00
using System.Reflection;
2025-04-27 16:13:15 +02:00
using AIStudio.Components;
using AIStudio.Tools.Metadata;
2024-09-01 20:10:03 +02:00
using AIStudio.Tools.Rust;
2024-06-30 15:26:28 +02:00
using Microsoft.AspNetCore.Components;
2024-08-21 08:30:01 +02:00
namespace AIStudio.Dialogs;
2024-06-30 15:26:28 +02:00
/// <summary>
/// The update dialog that is used to inform the user about an available update.
/// </summary>
2025-04-27 16:13:15 +02:00
public partial class UpdateDialog : MSGComponentBase
2024-06-30 15:26:28 +02:00
{
private static readonly Assembly ASSEMBLY = Assembly.GetExecutingAssembly();
private static readonly MetaDataAttribute META_DATA = ASSEMBLY.GetCustomAttribute<MetaDataAttribute>()!;
[CascadingParameter]
2025-03-12 19:12:56 +01:00
private IMudDialogInstance MudDialog { get; set; } = null!;
2024-06-30 15:26:28 +02:00
[Parameter]
public UpdateResponse UpdateResponse { get; set; }
2025-04-27 16:13:15 +02:00
private string HeaderText => string.Format(T("Update from v{0} to v{1}"), META_DATA.Version, this.UpdateResponse.NewVersion);
2024-06-30 15:26:28 +02:00
private void Cancel() => this.MudDialog.Cancel();
private void Confirm() => this.MudDialog.Close(DialogResult.Ok(true));
}