Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of a Directory from an IFileContainer.
        /// </summary>
        /// <param name="folder">The file container from which to create a Directory object for serialization.</param>
        /// <remarks>This constructor is used to convert from a user interface representation of a folder in the
        /// menu layout to a LFS Directory representation.</remarks>
        internal Directory(IFileContainer folder)
        {
            if (folder is Folder)
            {
                var directory = (Folder)folder;
                GlobalDirectoryNumber           = directory.GlobalDirectoryNumber;
                ParentDirectoryGlobalFileNumber = directory.ParentDirectoryGlobalFileNumber;
            }
            _presentationOrder = new PresentationOrder();
            int i = 0;

            foreach (var item in ((Folder)folder).Files)
            {
                if (item.GlobalFileNumber >= GlobalFileTable.TableSize)
                {
                    ErrorReporting.ReportError <System.InvalidOperationException>(ReportMechanism.Default, "Bad GFN", "Directory");
                }
                _presentationOrder[i] = item.GlobalFileNumber;
                ++i;
            }
        }
Ejemplo n.º 2
0
        private PresentationOrder GetPresentationOrder()
        {
            var presentationOrder = new PresentationOrder(Files);

            return(presentationOrder);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of a Directory.
 /// </summary>
 public Directory()
 {
     _parentDirectoryGlobalFileNumber = GlobalFileTable.InvalidFileNumber;
     _globalDirectoryNumber           = GlobalDirectoryTable.InvalidDirectoryNumber;
     _presentationOrder = new PresentationOrder();
 }
Ejemplo n.º 4
0
 /// <inheritdoc />
 public override int Deserialize(INTV.Core.Utility.BinaryReader reader)
 {
     _parentDirectoryGlobalFileNumber = reader.ReadUInt16();
     _presentationOrder = PresentationOrder.Inflate(reader);
     return(DeserializeByteCount);
 }