private bool SearchChildrensPaths(FligFolder FolderToSearch, string PathToSearchFor)
        {
            if (FolderToSearch.Path == PathToSearchFor)
            {
                return(true);
            }

            return(false);
        }
        private bool SearchChildrensPaths(FligFolder FolderToSearch, string PathToSearchFor)
        {
            if (FolderToSearch.Path == PathToSearchFor)
            {
                return true;
            }

            return false;
        }
        private FligFolder AddFolders(FligFolder startingFolder)
        {
            if (string.IsNullOrEmpty(startingFolder.Path))
                return startingFolder;

            foreach (var directory in Directory.GetDirectories(startingFolder.Path))
            {
                var newFolder = new FligFolder()
                {
                    Name = GetFolderName(directory),
                    Path = directory,
                };

                startingFolder.Children.Add(AddFolders(newFolder));
            }

            return startingFolder;
        }
        public void RefreshFolders(FligFolder startingFolder)
        {
            if (folderList == null)
                return;

            foreach (var folder in Directory.GetDirectories(startingFolder.Path))
            {
                if (SearchChildrensPaths(startingFolder, folder) == false)
                {
                    var newFolder = new FligFolder()
                    {
                        Name = GetFolderName(folder),
                        Path = folder
                    };
                    startingFolder.Children.Add(
                        AddFolders(newFolder));
                    RefreshFolders(newFolder);
                }
            }
        }
        private FligFolder AddFolders(FligFolder startingFolder)
        {
            if (string.IsNullOrEmpty(startingFolder.Path))
            {
                return(startingFolder);
            }

            foreach (var directory in Directory.GetDirectories(startingFolder.Path))
            {
                var newFolder = new FligFolder()
                {
                    Name = GetFolderName(directory),
                    Path = directory,
                };

                startingFolder.Children.Add(AddFolders(newFolder));
            }

            return(startingFolder);
        }
        public void RefreshFolders(FligFolder startingFolder)
        {
            if (folderList == null)
            {
                return;
            }

            foreach (var folder in Directory.GetDirectories(startingFolder.Path))
            {
                if (SearchChildrensPaths(startingFolder, folder) == false)
                {
                    var newFolder = new FligFolder()
                    {
                        Name = GetFolderName(folder),
                        Path = folder
                    };
                    startingFolder.Children.Add(
                        AddFolders(newFolder));
                    RefreshFolders(newFolder);
                }
            }
        }
 public FligFolder AddFolderRecursive(FligFolder startingFolder) => AddFolders(startingFolder);
 public FligFolder AddFolderRecursive(FligFolder startingFolder) => AddFolders(startingFolder);