public static LibraryFileInfo GetFromFile(string file, string fileName) { LibraryFileInfo info = new LibraryFileInfo { Name = fileName, Title = Path.GetFileNameWithoutExtension(fileName) }; if (File.Exists(file)) { FileInfo fileInfo = new FileInfo(file); info.FileSize = Math.Max(1, (int)fileInfo.Length / 1024); info.LastModDate = fileInfo.LastWriteTime; info.ImportDate = DateTime.Now; } info.FileToWeb = true; info.ImportStatus = 1; return(info); }
public LibraryFileInfo(LibraryFileInfo other) { FileId = other.FileId; Name = other.Name; Title = other.Title; Description = other.Description; FileSize = other.FileSize; LastModDate = other.LastModDate; ImportDate = other.ImportDate; RecordDate = other.RecordDate; UpdateFlags = other.UpdateFlags; //Permissions = other.Permissions; Flags = other.Flags; ImportStatus = other.ImportStatus; FileToWeb = other.FileToWeb; FileType = other.FileType; //if (other.LockInfo != null) //{ // LockInfo = other.LockInfo.Clone(); //} }
public LibraryFileResultInfo(LibraryFileInfo other) : base(other) { ExtraFields = new ExtraFields(); ParentCategories = new List <int>(); }