ZeroLauncher/dialog/EditTeamControl.xaml.cs
2024-08-04 18:03:32 +08:00

46 lines
1.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Windows;
using System.Windows.Controls;
using Zerolauncher.Manager;
namespace Zerolauncher.dialog
{
/// <summary>
/// EditTeamControl.xaml 的交互逻辑
/// </summary>
public partial class EditTeamControl : UserControl
{
bool isEditModle;
public EditTeamControl(bool isEditModle)
{
InitializeComponent();
this.isEditModle = isEditModle;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
if(string.IsNullOrEmpty(edit_name.Text))
{
MessageBox.Show("昵称不能为空喵!", "提示");
return;
}
if (isEditModle) AccountManager.editTeamName(edit_name.Text); else TeamManager.addTeam(edit_name.Text);
EditTeamDialog.Close();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
MessageBoxResult result = MessageBox.Show("放生此队伍以及队伍里所有的账号\n为你带来114514点功德\n要执行此操作喵", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.Cancel);
if (result == MessageBoxResult.OK)
{
if (!AccountManager.DeleteTeam())
{
MessageBox.Show("已经是最后一个队伍了喵!\n新建一个队伍后再放生这个~", "提示");
}
}
}
}
}