-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.cs
More file actions
34 lines (31 loc) · 1.07 KB
/
Form1.cs
File metadata and controls
34 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Tomlyn;
using Tomlyn.Model;
namespace FileOrganiserSuccession
{
public partial class Form1 : Form
{
private readonly string[] _filePath = Directory.GetFiles(Environment.CurrentDirectory);
private readonly TomlTable _fileTypes;
public Form1()
{
InitializeComponent();
lblFileCount.Text = $"Detected: {_filePath.Length} files";
_fileTypes = Toml.Parse(File.ReadAllText("file_mappings.toml")).ToModel();
}
private void btnOrganise_Click(object sender, EventArgs e)
{
foreach (string fileType in _fileTypes.Keys)
{
// WHAT DOES THIS MEAN AI
if (_fileTypes.TryGetValue(fileType, out var tomlArray1) && tomlArray1 is TomlArray fileExtensions)
{
Console.WriteLine($"{fileType}:");
foreach (var extension in fileExtensions)
{
Console.WriteLine(extension);
}
}
}
}
}
}