Example #1
0
        private void frmExtract_Load(object sender, EventArgs e)
        {
            if (mFlatName == string.Empty)                // root
            {
                foreach (Editor.Lib.ShaiyaDataEntry entry in mData.Files)
                {
                    mFileTodo += mData.GetFileCount(entry);
                }
            }
            else
            {
                mFileTodo = mData.GetFileCount(mData.GetFlatEntry(mFlatName));
            }

            mWorker.WorkerReportsProgress      = true;
            mWorker.WorkerSupportsCancellation = true;
            mWorker.DoWork             += new DoWorkEventHandler(mWorker_DoWork);
            mWorker.ProgressChanged    += new ProgressChangedEventHandler(mWorker_ProgressChanged);
            mWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(mWorker_RunWorkerCompleted);
            mWorker.RunWorkerAsync();
        }
Example #2
0
        private void FileTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode node = e.Node;

            if (node == FileTree.Nodes[0])                // root
            {
                return;
            }

            Editor.Lib.ShaiyaDataEntry entry = Data.GetFlatEntry(node.Name);
            if (entry == null)
            {
                MessageBox.Show("Failed to fetch Entry from File ôo");
            }
            if (entry.IsDir == true)
            {
                return;
            }

            byte[] buffer;
            Data.GetData(entry, out buffer);
            DoPreview(buffer, entry);
        }