/// <exception cref="CopeException">Can't open the file as RelicChunky!</exception>
        public RelicChunkyViewer(UniFile file)
            : this()
        {
            var rcf = new RelicChunkyFile(file);
            try
            {
                rcf.ReadData();
            }
            catch (Exception ex)
            {
                throw new CopeException(ex, "Can't open the file as RelicChunky!");
            }
            file.Close();

            m_rcf = rcf;
            _trv_chunks.Nodes.Clear();
            foreach (RelicChunk chunk in m_rcf.Chunks)
            {
                var tnC = new TreeNode();
                string tnName = chunk.ChunkHeader.TypeString + chunk.ChunkHeader.Signature;
                tnC.Name = tnName;
                tnC.Text = tnName;
                chunk.Tag = tnC;
                tnC.Tag = chunk;

                if (chunk is FoldChunk)
                    GetChunks(tnC, (FoldChunk)chunk);
                _trv_chunks.Nodes.Add(tnC);
            }
        }
Exemple #2
0
        /// <exception cref="CopeException">Can't open the file as RelicChunky!</exception>
        public RelicChunkyViewer(UniFile file)
            : this()
        {
            var rcf = new RelicChunkyFile(file);

            try
            {
                rcf.ReadData();
            }
            catch (Exception ex)
            {
                throw new CopeException(ex, "Can't open the file as RelicChunky!");
            }
            file.Close();

            m_rcf = rcf;
            _trv_chunks.Nodes.Clear();
            foreach (RelicChunk chunk in m_rcf.Chunks)
            {
                var    tnC    = new TreeNode();
                string tnName = chunk.ChunkHeader.TypeString + chunk.ChunkHeader.Signature;
                tnC.Name  = tnName;
                tnC.Text  = tnName;
                chunk.Tag = tnC;
                tnC.Tag   = chunk;

                if (chunk is FoldChunk)
                {
                    GetChunks(tnC, (FoldChunk)chunk);
                }
                _trv_chunks.Nodes.Add(tnC);
            }
        }
 public ChunkyStructureCollection(RelicChunkyFile parentFile) : this()
 {
     parent = parentFile;
 }