Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
01jeser committed May 30, 2021
1 parent 9ccfc8a commit 83138cd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions WpfApp1/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public string name
{
get
{
return fileName.Split('\\').Last().Split('.').First();
return string.Join(".", fileName.Split('\\').Last().Split('.').Reverse().Skip(1).Reverse());
}
}
public string uri
Expand Down Expand Up @@ -113,6 +113,8 @@ public static IEnumerable<string> GetFiles()
{
foreach (string s in Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)))
yield return s;
foreach (string s in Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory)))
yield return s;
foreach (string s in Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)))
if (!s.EndsWith("desktop.ini"))
yield return s;
Expand Down Expand Up @@ -187,7 +189,14 @@ private void OpenInExplorer_Click(object sender, RoutedEventArgs e)

private void Delete_Click(object sender, RoutedEventArgs e)
{
File.Delete((sender as MenuItem).Tag.ToString());
try
{
File.Delete((sender as MenuItem).Tag.ToString());
}
catch (Exception)
{

}
}

private void Button_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit 83138cd

Please sign in to comment.