Exemple #1
0
        public void ConvertionUni()
        {
            toggleControl();

            if (srcFile == null)
            {
                MessageBox.Show("Please Select a File that you want Convert..!");
            }
            else if (desFile == null)
            {
                MessageBox.Show("Please make a File that you want Save..!");
            }
            else if (fontCB.Enabled && fontCB.SelectedIndex < 0)
            {
                MessageBox.Show("Please Select a File Type that you want Convert..!");
            }
            else
            {
                UnicodeConverter.Converter.ConvertOption option;
                switch (fontCB.SelectedIndex)
                {
                case 0: option = UnicodeConverter.Converter.ConvertOption.Academy2Uni; break;

                case 1: option = UnicodeConverter.Converter.ConvertOption.Amyanmar2Uni; break;

                case 2: option = UnicodeConverter.Converter.ConvertOption.ATypeWriter2Uni; break;

                case 3: option = UnicodeConverter.Converter.ConvertOption.Ava2Uni; break;

                case 4: option = UnicodeConverter.Converter.ConvertOption.Ayar2Uni; break;

                case 5: option = UnicodeConverter.Converter.ConvertOption.CE2Uni; break;

                case 6: option = UnicodeConverter.Converter.ConvertOption.Gandamar2Uni; break;

                case 7: option = UnicodeConverter.Converter.ConvertOption.I2Uni; break;

                case 8: option = UnicodeConverter.Converter.ConvertOption.Metrix2Uni; break;

                case 9: option = UnicodeConverter.Converter.ConvertOption.MMyanmar2Uni; break;

                case 10: option = UnicodeConverter.Converter.ConvertOption.Myanmar12Uni; break;

                case 11: option = UnicodeConverter.Converter.ConvertOption.MyaZedi2Uni; break;

                case 12: option = UnicodeConverter.Converter.ConvertOption.Pinny52Uni; break;

                case 13: option = UnicodeConverter.Converter.ConvertOption.Win2Uni; break;

                default: option = UnicodeConverter.Converter.ConvertOption.Zawgyi2Uni; break;
                }

                if (Conversion.Convert(srcFile, desFile, option))
                {
                    LblStatus.Text       = "Converted Successfully!";
                    txtSrcFile.Text      = "";
                    txtSave.Text         = "";
                    fontCB.SelectedIndex = -1;
                    string temp   = desFile.Substring(0, desFile.LastIndexOf('\\')) + "\\TempXml.xml";
                    string finish = desFile.Substring(0, desFile.LastIndexOf('\\')) + "\\finishxml.xml";
                    File.Delete(temp);
                    File.Delete(finish);
                }
            }
            toggleControl();
        }