using DataLoader.CS;
using System;
using System.ComponentModel;
using System.IO;
namespace DataLoader.Model
{
///
/// 通用属性类
///
public class CommonProp // : INotifyPropertyChanged
{
///
/// 初始化
///
public static void Init()
{
string startPath = Tools.GetSetting("StartPath");
int.TryParse(startPath, out StartPath);
SourcePath = Tools.GetSetting("SourcePath");
TargetPath = Tools.GetSetting("TargetPath");
Owner.tbSource.Text = SourcePath;
Owner.tbTarget.Text = TargetPath;
}
///
/// 所有者
///
public static MainWindow Owner;
///
/// 开始目录
///
public static int StartPath;
///
/// 用户ID
///
public static int UserId = 1;
///
/// 用户名
///
public static string Uname = "admin";
///
/// 令牌
///
public static string Token;
///
/// 单位编码
///
public static string Depcode;
///
/// 单位名称
///
public static string Depname;
///
/// 目录ID
///
public static int dirId;
///
/// 目录编码
///
public static string Dircode;
///
/// 目录名称
///
public static string Dirname;
///
/// 元数据类型
///
public static int MetaType;
///
/// 数据目录
///
public static string SourcePath;
///
/// 入库目录
///
public static string TargetPath;
///
/// 传感器类型
///
public static int SensorType;
///
/// 采集时间
///
public static DateTime? AcqTime;
/*private string _sourcePath;
///
/// 数据源目录
///
public string SourcePath
{
get { return _sourcePath; }
set
{
if (!String.IsNullOrEmpty(value) && Directory.Exists(value))
{
_sourcePath = value;
PropertyChanged(this, new PropertyChangedEventArgs("SourcePath"));
}
}
}
private string _targetPath;
///
/// 目标目录
///
public string TargetPath
{
get { return _targetPath; }
set
{
if (!String.IsNullOrEmpty(value) && Directory.Exists(value))
{
_targetPath = value;
PropertyChanged(this, new PropertyChangedEventArgs("TargetPath"));
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
//PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}*/
}
}