Beispiel #1
0
        /// <summary>
        /// Load all sub-folders into the Folders collection of the
        /// given <paramref name="parentItem"/>.
        /// </summary>
        /// <param name="parentItem"></param>
        internal static void LoadFolders(ITreeItemViewModel parentItem)
        {
            try
            {
                parentItem.ChildrenClear();

                foreach (string dir in Directory.GetDirectories(parentItem.ItemPath))
                {
                    try
                    {
                        FolderViewModel.AddFolder(dir, parentItem);
                    }
                    catch (UnauthorizedAccessException ae)
                    {
                        parentItem.ShowNotification(FileSystemModels.Local.Strings.STR_MSG_UnknownError, ae.Message);
                    }
                    catch (IOException ie)
                    {
                        parentItem.ShowNotification(FileSystemModels.Local.Strings.STR_MSG_UnknownError, ie.Message);
                    }
                }
            }
            catch (UnauthorizedAccessException ae)
            {
                parentItem.ShowNotification(FileSystemModels.Local.Strings.STR_MSG_UnknownError, ae.Message);
            }
            catch (IOException ie)
            {
                parentItem.ShowNotification(FileSystemModels.Local.Strings.STR_MSG_UnknownError, ie.Message);
            }
        }
 internal static void AddFolder(FolderViewModel f, FolderViewModel item)
 {
     Application.Current.Dispatcher.Invoke(() =>
     {
         f.AddFolder(item);
     });
 }