using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPASmart.Model
{
public class FileConfigModel
{
public static string ConstPath { get; set; } = string.Empty;
///
/// 变量配置路径
///
public static string VarConfigPath
{
get
{
string ReturnValue = null;
if (Directory.Exists(ConstPath))
{
string path = $"{ConstPath}\\{ConfigDirName}\\JSON";
Directory.CreateDirectory(path);
ReturnValue = $"{ConstPath}\\{ConfigDirName}\\JSON\\CommunicationPar.json";
}
return ReturnValue;
}
}
///
/// 获取二进制文件配置路径
///
///
public static string GetBinConfigPath
{
get
{
string ReturnValue = null;
if (Directory.Exists(ConstPath))
{
string path = $"{ConstPath}\\{ConfigDirName}\\{BaseConfig}";
Directory.CreateDirectory(path);
ReturnValue = $"{ConstPath}\\{ConfigDirName}\\{BaseConfig}\\{BinConfigFileName}";
}
return ReturnValue;
}
}
///
/// 变量管理器路径
///
public static string VarManagerPath => $"{AppDomain.CurrentDomain.BaseDirectory}BPASmart.VariableManager.exe";
///
/// 页面文件夹名称
///
public const string PageDirName = "Layouts";
///
/// 配置文件文件夹名称
///
public const string ConfigDirName = "AccessFile";
///
/// 基本配置文件夹名称
///
public const string BaseConfig = "Bin";
///
/// 二进制配置文件名
///
public const string BinConfigFileName = "BinConfigFile.ser";
}
}