Avoid errors on file system when populating entries
This commit is contained in:
parent
bf63813e90
commit
d54bf3c4e8
1 changed files with 27 additions and 19 deletions
|
@ -333,32 +333,40 @@
|
||||||
{
|
{
|
||||||
if (Directory.Exists(entry))
|
if (Directory.Exists(entry))
|
||||||
{
|
{
|
||||||
var info = new DirectoryInfo(entry);
|
try
|
||||||
var directory = new FileManagerDirectory
|
|
||||||
{
|
{
|
||||||
Path = entry,
|
var info = new DirectoryInfo(entry);
|
||||||
Name = entry.Substring(Path.Path.Length).TrimStart(separator),
|
var directory = new FileManagerDirectory
|
||||||
ModifiedOn = info.LastWriteTime,
|
{
|
||||||
CreatedOn = info.CreationTime,
|
Path = entry,
|
||||||
};
|
Name = entry.Substring(Path.Path.Length).TrimStart(separator),
|
||||||
|
ModifiedOn = info.LastWriteTime,
|
||||||
|
CreatedOn = info.CreationTime,
|
||||||
|
};
|
||||||
|
|
||||||
if (EntryVisible.Invoke(directory))
|
if (EntryVisible.Invoke(directory))
|
||||||
Entries.Add(directory);
|
Entries.Add(directory);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var info = new FileInfo(entry);
|
try
|
||||||
var file = new FileManagerFile
|
|
||||||
{
|
{
|
||||||
Path = entry,
|
var info = new FileInfo(entry);
|
||||||
Name = System.IO.Path.GetFileName(entry),
|
var file = new FileManagerFile
|
||||||
ModifiedOn = info.LastWriteTime,
|
{
|
||||||
CreatedOn = info.CreationTime,
|
Path = entry,
|
||||||
Size = info.Length
|
Name = System.IO.Path.GetFileName(entry),
|
||||||
};
|
ModifiedOn = info.LastWriteTime,
|
||||||
|
CreatedOn = info.CreationTime,
|
||||||
|
Size = info.Length
|
||||||
|
};
|
||||||
|
|
||||||
if (EntryVisible.Invoke(file))
|
if (EntryVisible.Invoke(file))
|
||||||
Entries.Add(file);
|
Entries.Add(file);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue