editorconfig
This commit is contained in:
2023-10-20 19:37:19 -07:00
parent b54ea97c67
commit a4a92aacd2
68 changed files with 703 additions and 553 deletions

View File

@ -103,7 +103,7 @@ public partial class DragDropSetPropertyItem : Form
private List<Record> GetRecords(ASCIIEncoding asciiEncoding, int tagId, List<string> files)
{
List<Record> results = new();
List<Record> results = [];
int? id;
string? value;
string? message;
@ -179,9 +179,9 @@ public partial class DragDropSetPropertyItem : Form
short type = 1;
ASCIIEncoding asciiEncoding = new();
int xpKeywords = (int)IExif.Tags.XPKeywords;
ConstructorInfo? constructorInfo = typeof(PropertyItem).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public, null, Array.Empty<Type>(), null) ?? throw new Exception();
ConstructorInfo? constructorInfo = typeof(PropertyItem).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public, null, [], null) ?? throw new Exception();
List<Record> records = GetRecords(asciiEncoding, xpKeywords, files);
if (!records.Any())
if (records.Count == 0)
SetMessage("No data");
else
SetPropertyItem(setTo, xpKeywords, type, asciiEncoding, constructorInfo, records);
@ -190,7 +190,7 @@ public partial class DragDropSetPropertyItem : Form
private void SetPropertyItem(string[] paths, string setTo)
{
FileInfo fileInfo;
List<string> files = new();
List<string> files = [];
foreach (string path in paths.OrderBy(l => l))
{
fileInfo = new(path);
@ -203,7 +203,7 @@ public partial class DragDropSetPropertyItem : Form
files.AddRange(Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly));
}
}
if (!files.Any())
if (files.Count == 0)
SetMessage("No data");
else
SetPropertyItem(setTo, files);
@ -221,7 +221,7 @@ public partial class DragDropSetPropertyItem : Form
{
try
{
if (e.Data is not null && e.Data.GetData(DataFormats.FileDrop) is string[] paths && paths.Any())
if (e.Data is not null && e.Data.GetData(DataFormats.FileDrop) is string[] paths && paths.Length != 0)
SetPropertyItem(paths);
else
{