コード例 #1
0
 public bool WriteToFile(FileStructure structure, string outFilePath)
 {
     if (structure != null)
     {
         var loc = structure.Location;
         return(fManager.WriteToFile(loc, outFilePath, structure.Hash, LEN));
     }
     return(false);
 }
コード例 #2
0
        public void ChangeFile(int id, FileStructure fileStructure)
        {
            if (GetFileStructure(id) == null)
            {
                return;
            }

            files[id] = fileStructure;
            IsChenged = true;
        }
コード例 #3
0
        public void CreateFile(int id, int parent, string name, long location, string hash, Dictionary <string, string> additionals = null)
        {
            var fileStructure = new FileStructure
            {
                Id       = id,
                Parent   = parent,
                Name     = name,
                Location = location,
                Hash     = hash,
            };

            if (additionals != null)
            {
                fileStructure.Additional = new Dictionary <string, string>();
                var zip = additionals.Keys.Zip(additionals.Values, (_key, _value) => new { key = _key, value = _value });
                foreach (var val in zip)
                {
                    fileStructure.Additional.Add(val.key, val.value);
                }
            }

            CreateFile(fileStructure);
        }
コード例 #4
0
 public void CreateFile(FileStructure fileStructure)
 {
     files.Add(fileStructure.Id, fileStructure);
     NextFileId++;
     IsChenged = true;
 }