Switch-Toolbox/Switch_Toolbox_Library/Forms/SceneSelector.cs

42 lines
1 KiB
C#
Raw Normal View History

2019-07-13 14:56:21 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Switch_Toolbox.Library.Forms
{
public partial class SceneSelector : STForm
{
public string SelectedFile = "";
public SceneSelector()
{
InitializeComponent();
treeView1.BackColor = FormThemes.BaseTheme.FormBackColor;
treeView1.ForeColor = FormThemes.BaseTheme.FormForeColor;
}
public void LoadDictionary(Dictionary<string,string> Files)
{
treeView1.BeginUpdate();
foreach (var file in Files)
treeView1.Nodes.Add(new TreeNode(file.Value) { Tag = file.Key, });
treeView1.EndUpdate();
}
private void treeView1_DoubleClick(object sender, EventArgs e)
{
SelectedFile = (string)treeView1.SelectedNode.Tag;
DialogResult = DialogResult.OK;
}
}
}