Finished up the profile manager for now and added some code to get the FileViewer started.

This commit is contained in:
Admin
2020-11-09 11:04:59 -06:00
parent 5468c1ad97
commit 09ef449909
5 changed files with 407 additions and 106 deletions
+28 -5
View File
@@ -12,19 +12,42 @@ namespace DataOrganizer
{
public partial class FileViewer : Form
{
private List<DB.Profile> Profiles { get; } = new List<DB.Profile>();
public FileViewer()
{
InitializeComponent();
var db = new DB();
var profiles = db.GetProfiles();
Profiles = db.GetProfiles();
if(profiles.Count == 0)
foreach(var profile in Profiles)
{
// insert
var man = new ProfileManager();
man.ShowDialog();
ProfileComboBox.Items.Add(profile.Name);
}
ProfileComboBox.SelectedIndexChanged += ProfileComboBox_SelectedIndexChanged;
ProfileComboBox.SelectedIndex = 0;
}
private void ProfileComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
var profile = Profiles[ProfileComboBox.SelectedIndex];
RootFolderComboBox.Items.Clear();
if (profile.FolderGroups.Count > 0)
{
foreach (var folder in profile.FolderGroups)
{
RootFolderComboBox.Items.Add(folder.Name);
}
RootFolderComboBox.SelectedIndex = 0;
}
RootFolderComboBox.Enabled = true;
}
private void FolderSelectButton_Click(object sender, EventArgs e)