using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Linq.Expressions; namespace IStation { /// /// 文件参数 /// public class Paras_File { /// /// 是否加密 /// public bool IsEncryption { get; set; } /// /// 加密密码 /// public string EncryptionKey { get; set; } /// /// 数据文件夹 /// public string DataFolder { get { return _datafolder; } set { _datafolder = value; } } private string _datafolder = "Data"; /// /// 文件存储文件夹 /// public string FileStorageFolder { get { return _fileStorageFolder; } set { _fileStorageFolder = value; } } private string _fileStorageFolder = "FileStorage"; /// /// 获取全路径 /// /// 属性名称 public string GetFullPath(string propertyName) { var path = string.Empty; switch (propertyName) { case nameof(DataFolder): { path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,DataFolder); } break; case nameof(FileStorageFolder): { path = System.IO.Path.Combine(GetFullPath(nameof(DataFolder)), FileStorageFolder); } break; default:break; } return path; } } }