using System.Collections.Generic;
using QC.CTDS.DM.SharedLibrary;

namespace QC.CTDS.DM.DataStructures;

public class FolderItem : FileSystemItem
{
	public bool IncludeSubFolders { get; set; }

	public List<FileSystemItem> GetFiles()
	{
		List<FileSystemItem> list = new List<FileSystemItem>();
		foreach (string file in CommonFunctions.GetFiles(base.FullPath, IncludeSubFolders, "*.xml"))
		{
			list.Add(new FileSystemItem
			{
				FullPath = file
			});
		}
		foreach (string file2 in CommonFunctions.GetFiles(base.FullPath, IncludeSubFolders, "*.cxml"))
		{
			list.Add(new FileSystemItem
			{
				FullPath = CommonFunctions.DecompressCXML(file2)
			});
		}
		if (list.Count == 0)
		{
			foreach (string file3 in CommonFunctions.GetFiles(base.FullPath, IncludeSubFolders, "*.csv"))
			{
				list.Add(new FileSystemItem
				{
					FullPath = file3
				});
			}
		}
		return list;
	}
}
