1
0
mirror of synced 2025-01-31 12:23:52 +01:00

File selector fixes

This commit is contained in:
KillzXGaming 2019-08-29 19:48:07 -04:00
parent 18ffeb980b
commit e0b67515a8
2 changed files with 16 additions and 8 deletions

View File

@ -24,20 +24,28 @@ namespace LayoutBXLYT
listViewCustom1.MultiSelect = true;
}
public List<int> SelectedIndices()
public List<BFLYT> SelectedLayouts()
{
List<int> indices = new List<int>();
foreach (int index in listViewCustom1.SelectedIndices)
indices.Add(index);
List<BFLYT> layouts = new List<BFLYT>();
foreach (ListViewItem item in listViewCustom1.SelectedItems)
layouts.Add((BFLYT)item.Tag);
return indices;
listViewCustom1.Items.Clear();
return layouts;
}
public void LoadLayoutFiles(List<BFLYT> layoutFiles)
{
listViewCustom1.BeginUpdate();
foreach (var file in layoutFiles)
listViewCustom1.Items.Add(file.FileName);
{
listViewCustom1.Items.Add(new ListViewItem()
{
Text = file.FileName,
Tag = file,
});
}
listViewCustom1.Sort();
listViewCustom1.EndUpdate();

View File

@ -287,9 +287,9 @@ namespace LayoutBXLYT
form.LoadLayoutFiles(layouts);
if (form.ShowDialog() == DialogResult.OK)
{
foreach (var index in form.SelectedIndices())
foreach (var layout in form.SelectedLayouts())
{
LoadBflyt(layouts[index].header, file.FileName);
LoadBflyt(layout.header, file.FileName);
}
}
}