Пример #1
0
        private void replaceWithFileButton_Click(object sender, EventArgs e)
        {
            int n = tlkFileBox.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            TalkFile           tlk        = tlkFileSets[bioTlkSetBox.SelectedIndex].talkFiles[n];
            HuffmanCompression compressor = new HuffmanCompression();

            OpenFileDialog d = new OpenFileDialog();

            d.Filter = "*.xml|*.xml";
            if (d.ShowDialog() == DialogResult.OK)
            {
                compressor.LoadInputData(d.FileName);
                compressor.replaceTlkwithFile(tlk.pcc, tlk.index);
                MessageBox.Show("Done");
            }
            n = packages.FindIndex(x => tlk.pcc.pccFileName == x.pccFileName);
            packages.RemoveAt(n);
            packages.Insert(n, new PCCObject(tlk.pcc.pccFileName));
            refreshFileBox();
        }
Пример #2
0
        private void replaceWithFileButton_Click(object sender, EventArgs e)
        {
            int n = tlkFileBox.SelectedIndex;
            if (n == -1)
            {
                return;
            }
            TalkFile tlk = tlkFileSets[bioTlkSetBox.SelectedIndex].talkFiles[n];
            HuffmanCompression compressor = new HuffmanCompression();

            OpenFileDialog d = new OpenFileDialog();
            d.Filter = "*.xml|*.xml";
            if (d.ShowDialog() == DialogResult.OK)
            {
                compressor.LoadInputData(d.FileName);
                compressor.replaceTlkwithFile(tlk.pcc, tlk.index);
                MessageBox.Show("Done");
            }
            n = packages.FindIndex(x => tlk.pcc.FileName == x.FileName);
            packages.RemoveAt(n);
            packages.Insert(n, MEPackageHandler.OpenME1Package(tlk.pcc.FileName));
            refreshFileBox();
        }