// get file information public static List <Dictionary <string, object> > GetFilesInfo(string fileId = null) { var files = new List <Dictionary <string, object> >(); // run through all the stored files foreach (var file in GetStoredFiles()) { // write all the parameters to the map var dictionary = new Dictionary <string, object>(); dictionary.Add("version", GetFileVersion(file.Name, null)); dictionary.Add("id", ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress() + "/" + file.Name + "/" + File.GetLastWriteTime(DocManagerHelper.StoragePath(file.Name, null)).GetHashCode())); dictionary.Add("contentLength", Math.Round(file.Length / 1024.0, 2) + " KB"); dictionary.Add("pureContentLength", file.Length); dictionary.Add("title", file.Name); dictionary.Add("updated", file.LastWriteTime.ToString()); // get file information by its id if (fileId != null) { if (fileId.Equals(dictionary["id"])) { files.Add(dictionary); break; } } else { files.Add(dictionary); } } return(files); }