using System.Collections.Generic;

namespace QC.CTDS.DM.DataStructures;

public class FileSystemItemsGroup
{
	private string groupName;

	private List<FileSystemItem> fileSystemItemsList = new List<FileSystemItem>();

	public string GroupName
	{
		get
		{
			return groupName;
		}
		set
		{
			groupName = value;
		}
	}

	public List<FileSystemItem> FileSystemItemsList
	{
		get
		{
			return fileSystemItemsList;
		}
		set
		{
			fileSystemItemsList = value;
		}
	}

	public List<FileSystemItem> GetFiles()
	{
		List<FileSystemItem> list = new List<FileSystemItem>();
		foreach (FileSystemItem fileSystemItems in FileSystemItemsList)
		{
			if (fileSystemItems is FolderItem)
			{
				FolderItem folderItem = (FolderItem)fileSystemItems;
				list.AddRange(folderItem.GetFiles());
			}
			else
			{
				list.Add(fileSystemItems);
			}
		}
		return list;
	}
}
