DSIK_FILEZILLA/sikFtpClient/Model/LocalDirectoryModel.cs

35 lines
905 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace sikFtpClient.Model
{
public class LocalDirectoryModel : DiscElementModel
{
public LocalDirectoryModel(string path) : base(path)
{
}
public static List<DiscElementModel> GetContent(string path)
{
var directories = Directory.GetDirectories(path);
var files = Directory.GetFiles(path);
List<DiscElementModel> result = new List<DiscElementModel>();
foreach (var file in files)
{
result.Add(new LocalFileModel(file));
}
foreach (var directory in directories)
{
result.Add(new LocalDirectoryModel(directory));
}
return result;
}
}
}