private void onIsSelectedChanged(object sender, EventArgs e)
        {
            FileTreeItem item = (FileTreeItem)sender;
            bool         isCurrentSelected = item.IsSelected ?? false;

            if (sender is FolderData)
            {
                //update all inner state
                foreach (var folder in new FolderDataEnumerable((FolderData)sender)
                         .Reverse())
                {
                    foreach (var file in folder.Files)
                    {
                        file.SetIsSelected(isCurrentSelected);
                    }
                    folder.UpdateFolderState(isCurrentSelected);
                }
            }

            //update all upper folder state
            foreach (var folder in new UpperFolderEnumerable(item))
            {
                folder.UpdateFolderState(isCurrentSelected);
            }
        }
Exemplo n.º 2
0
 public UpperFolderEnumerable(FileTreeItem source)
 {
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     this.source = source;
 }