work on characterlist
This commit is contained in:
@@ -4,7 +4,9 @@ using OwnChar.Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Windows.Forms;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.UI;
|
||||
using Telerik.Windows.Documents.Fixed.Model.Navigation;
|
||||
|
||||
namespace OwnChar.App.Desktop.UI.MainTabs.Controls;
|
||||
|
||||
@@ -55,7 +57,7 @@ public partial class CharacterListControl : UserControl
|
||||
radListView_CharList.BeginUpdate();
|
||||
radListView_CharList.Items.Clear();
|
||||
|
||||
if (profile != null && mainApi?.Manager?.Characters.GetCharacters(profile) is IEnumerable<Character> characters)
|
||||
if (profile != null && mainApi.Manager?.Characters.GetCharacters(profile) is IEnumerable<Character> characters)
|
||||
{
|
||||
foreach (Character character in characters)
|
||||
{
|
||||
@@ -95,9 +97,17 @@ public partial class CharacterListControl : UserControl
|
||||
AddCharToList(newChar);
|
||||
}
|
||||
|
||||
private void DelChar()
|
||||
private void TryDelChar()
|
||||
{
|
||||
var selChar = GetSelectedChar();
|
||||
|
||||
if (selChar != null)
|
||||
{
|
||||
if (RadMessageBox.Show(string.Format(CharListControlLangRes.MsgBox_ConfirmDeletion_Text, selChar.Name), CharListControlLangRes.MsgBox_ConfirmDeletion_Title, MessageBoxButtons.YesNo, RadMessageIcon.Exclamation) == DialogResult.Yes)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TryOpenChar(Character? character)
|
||||
@@ -120,7 +130,7 @@ public partial class CharacterListControl : UserControl
|
||||
|
||||
private void RadMenuItem_DeleteChar_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
DelChar();
|
||||
TryDelChar();
|
||||
}
|
||||
|
||||
private void RadMenuItem_OpenChar_Click(object sender, System.EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user