コード例 #1
0
        private void DeleteFile()
        {
            if (SelectedItems != null)
            {
                var item = SelectedItems.FirstOrDefault();

                if (item != null && File.Exists(item.Path))
                {
                    File.Delete(item.Path);
                    CurrentFolderItems.Remove(item);
                }
            }
        }
コード例 #2
0
ファイル: ExplorerVM.cs プロジェクト: Stavvor/liteFTP
 protected void ParrentFolder()
 {
     if (!String.IsNullOrEmpty(CurrentPath))
     {
         string[] path = CurrentPath.Split('\\');
         if (path.Length <= 2 && path.Any(i => String.IsNullOrEmpty(i)))
         {
             CurrentFolderItems.Clear();
             DirectoryItemVM item = Items.FirstOrDefault(i => i.Name == $"{path.FirstOrDefault()}\\");
             item.ClearChildren();
         }
         var parrent = Directory.GetParent(CurrentPath);
         if (parrent != null)
         {
             CurrentPath = parrent.FullName;
         }
     }
 }