1
0
mirror of synced 2025-01-31 04:13:51 +01:00

Fix removing byml properties from dictionaries and lists on save

This commit is contained in:
KillzXGaming 2019-06-25 15:13:00 -04:00
parent d664a47426
commit 7cd86b9a05
5 changed files with 6 additions and 1 deletions

Binary file not shown.

View File

@ -534,10 +534,15 @@ namespace FirstPlugin
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listViewCustom1.SelectedItems.Count <= 0)
if (listViewCustom1.SelectedItems.Count <= 0 || treeView1.SelectedNode == null)
return;
dynamic targetNode = treeView1.SelectedNode.Tag;
dynamic target = listViewCustom1.SelectedItems[0].Tag;
if (targetNode is IDictionary<string, dynamic>)
((IDictionary<string, dynamic>)targetNode).Remove(listViewCustom1.SelectedItems[0].Text);
if (targetNode is IList<dynamic>)
((IList<dynamic>)targetNode).Remove(target);
int index = listViewCustom1.Items.IndexOf(listViewCustom1.SelectedItems[0]);