コード例 #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;
            }
        }
コード例 #2
0
ファイル: Folder.cs プロジェクト: intvsteve/VINTage
        private PresentationOrder GetPresentationOrder()
        {
            var presentationOrder = new PresentationOrder(Files);

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