Finished up the profile manager for now and added some code to get the FileViewer started.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user