Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "")
            {
                string file    = textBox1.Text;
                string newFile = textBox2.Text;
                if (file.Contains(".gb"))
                {
                    //Converter converter = new Converter();
                    //converter.readFile(file, newFile);
                    //Console.WriteLine(converter.getFile());
                    //ConvertGbToTBL convertGbToTBL = new ConvertGbToTBL();
                    //convertGbToTBL.readFile(file, newFile);
                    ConverterGbv2 converterGbv2 = new ConverterGbv2();
                    converterGbv2.readFile(file, newFile);
                }
                else if (file.Contains(".gff"))
                {
                    ConvertGffToTBL converter = new ConvertGffToTBL();
                    converter.readFile(file, newFile);
                    //Console.WriteLine(converter.getFile());
                }

                //FileStream fs = (FileStream) saveFileDialog1.OpenFile();
            }
            else if (textBox1.Text == "")
            {
                MessageBox.Show("Choose file to convert");
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Choose place to save a new tbl file");
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "")
            {
                string file    = textBox1.Text;
                string newFile = textBox2.Text;
                if (file.Contains(".gb"))
                {
                    HashSet <string> keys = new HashSet <string>();
                    foreach (var obj in this.checkBoxList)
                    {
                        if (obj.Checked)
                        {
                            keys.Add(obj.Text);
                        }
                    }
                    HashSet <string> names = new HashSet <string>();
                    foreach (var obj in this.checkBoxList)
                    {
                        if (obj.Checked && obj.Name.Contains("NAME_"))
                        {
                            names.Add(obj.Text);
                        }
                    }
                    //Converter converter = new Converter();
                    //converter.readFile(file, newFile);
                    //Console.WriteLine(converter.getFile());
                    //ConvertGbToTBL convertGbToTBL = new ConvertGbToTBL();
                    //convertGbToTBL.readFile(file, newFile);
                    ConverterGbv2 converterGbv2 = new ConverterGbv2();
                    converterGbv2.readFile(file, newFile, keys, names);
                }
                else if (file.Contains(".gff"))
                {
                    ConvertGffToTBL converter = new ConvertGffToTBL();
                    converter.readFile(file, newFile);
                    //Console.WriteLine(converter.getFile());
                }

                //FileStream fs = (FileStream) saveFileDialog1.OpenFile();
            }
            else if (textBox1.Text == "")
            {
                MessageBox.Show("Choose file to convert");
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Choose place to save a new tbl file");
            }
        }