using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace AppReleaseCheckTool.Models
{
public class FolderInfoModel
{
public string FolderName
{
get;
set;
}
public string FolderPath
{
get;
set;
}
public FolderInfoModel ParentFolder
{
get;
set;
}
public List<FolderInfoModel> ChildFolder
{
get;
set;
}
public List<FileInfoModel> FileList
{
get;
set;
}
public DateTime CreateTime
{
get;
set;
}
public bool IsFilter
{
get;
set;
}
public XElement GetModelXml()
{
XElement xml = new XElement("FolderInfo",
new XAttribute("FolderName", this.FolderName),
new XAttribute("FolderPath", this.FolderPath),
new XAttribute("CreateTime", this.CreateTime.ToString()));
return xml;
}
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace AppReleaseCheckTool.Models
{
public class FileInfoModel
{
private string _filename = string.Empty;
public string FileName
{
get
{
return _filename;
}
set
{
if (!string.IsNullOrEmpty(value))
{
_filename = value;
if (FileExt.ToLower() == ".dll" || FileExt.ToLower() == ".exe")
{
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(FilePath + "\\" + value);
_versin = fileVersionInfo.ProductVersion;
_productmajorpart = fileVersionInfo.ProductMajorPart;
_company = fileVersionInfo.CompanyName;
}
}
}
}
public string FilePath
{
get;
set;
}
public string RelativePath
{
get;
set;
}
public string FileExt
{
get;
set;
}
public long FileSize
{
get;
set;
}
public DateTime CreateTime
{
get;
set;
}
public DateTime ModifyTime
{
get;
set;
}
private string _versin = string.Empty;
public string Version
{
get
{
return _versin;
}
}
private string _company = string.Empty;
public string Company
{
get
{
return _company;
}
}
private int _productmajorpart =0;
public int ProductMajorPart
{
get
{
return _productmajorpart;
}
}
public bool IsFilter
{
get;
set;
}
public FolderInfoModel ParentFolder
{
get;
set;
}
public XElement GetModelXml()
{
XElement xml = new XElement("FileInfo",
new XAttribute("FileName", this.FileName),
new XAttribute("FilePath", this.RelativePath),
new XAttribute("CreateTime", this.CreateTime.ToString()),
new XAttribute("ModifyTime", this.ModifyTime.ToString()),
new XAttribute("Version", this.Version),
new XAttribute("FileSize", this.FileSize));
return xml;
}
}
}