Esempio n. 1
0
        /// <summary>
        /// Creates and returns a dir from the given serialized data.
        /// </summary>
        public static HashDir GetDirFromSerializedData(SerializedHashDir serializedDir)
        {
            var dir = new HashDir();

            dir.DirId       = serializedDir.DirId;
            dir.ParentDirId = serializedDir.ParentDirId;
            dir.Name        = serializedDir.Name;
            dir.ChildsDirId = SList.FromArray(serializedDir.ChildsDirId);
            dir.FilesId     = SList.FromArray(serializedDir.FilesId);

            dir.Childs = SList.Create <HashDir>(dir.ChildsDirId.Count);
            dir.Files  = SList.Create <HashFile>(dir.FilesId.Count);

            return(dir);
        }