void GetChildrenForItem(object itemExpanded)
        {
            //get the object being expanded
            DirectoryDisplayItem displayItem = (DirectoryDisplayItem)itemExpanded;

            //check if the children of this item are dummy items
            if (displayItem.ContainsDummyItems)
            {
                //if the children are dummy children replace them with the actual data
                displayItem.ChildItems.Clear();
                var modelData = GetService <IExplorer>().GetChildDirectories(displayItem.Path);
                if (modelData != null)
                {
                    var children = from x in modelData
                                   select new DirectoryDisplayItem {
                        Name = x.Name, Path = x.FullName
                    };

                    //add all the data to the list
                    foreach (var child in children)
                    {
                        displayItem.ChildItems.Add(child);
                    }
                    displayItem.ContainsDummyItems = false;
                }
            }
        }
示例#2
0
 void OnDirectorySelected(DirectoryDisplayItem selectedItem)
 {
     //load all files for the directory specified
     DataSource = GetService<IExplorer>().GetChildFiles(selectedItem.Path);
 }
示例#3
0
 /// <summary>
 /// Checks if the specified item is a dummy item
 /// </summary>
 /// <param name="item">The item to check</param>
 /// <returns>Returns true if the item is a dummy item</returns>
 public static bool IsDummyItem(DirectoryDisplayItem item)
 {
     return item.Name == DummyItem;
 }
示例#4
0
 void OnDirectorySelected(DirectoryDisplayItem selectedItem)
 {
     //load all files for the directory specified
     DataSource = GetService <IExplorer>().GetChildFiles(selectedItem.Path);
 }
 /// <summary>
 /// Checks if the specified item is a dummy item
 /// </summary>
 /// <param name="item">The item to check</param>
 /// <returns>Returns true if the item is a dummy item</returns>
 public static bool IsDummyItem(DirectoryDisplayItem item)
 {
     return(item.Name == DummyItem);
 }