コード例 #1
0
        public void OpenFile_Click(object sender, EventArgs e)
        {
            string path = "", path2 = "";

            path = AndiFileDialog.OpenDialog(path, Path.GetDirectoryName(_LastPath), "Evolution Narc File - File Open", "Any Files|*.*|Narc Files|*.*");

            if (path != "")
            {
                flepath = new FileInfo(path);
                Program.mForm.fname.Text = flepath.Name;
                Program.mForm.fsize.Text = flepath.Length + "";

                path2 = AndiFileDialog.OpenDialog(path2, Path.GetDirectoryName(_LastPath), "BabyEvolution Narc File - File Open", "Any Files|*.*|Narc Files|*.*");
            }

            if (path2 != "")
            {
                if (CheckMagicHeaderID.get(path2) != "NARC")
                {
                    MessageBox.Show(
                        "This Not NARC File, File Extension Signature is " + CheckMagicHeaderID.get(path2) + ", and is not NARC File!", "Error!");
                    isBabyEvoOpened            = false;
                    andiImageComboBox4.Enabled = false;
                }
                else
                {
                    andiImageComboBox4.Enabled = true;
                    Narc[1] = new AndiNarcReader();
                    Narc[1].OpenData(path2);
                    isBabyEvoOpened = true;
                }
            }
            else
            {
                isBabyEvoOpened            = false;
                andiImageComboBox4.Enabled = false;
            }

            if (path != "")
            {
                Program.GlobalPath = Path.GetDirectoryName(path);
                _LastPath          = path;

                if (CheckMagicHeaderID.get(path) != "NARC")
                {
                    MessageBox.Show("This Not NARC File, File Extension Signature is " + CheckMagicHeaderID.get(path) + ", and is not NARC File!", "Error!");
                    return;
                }

                andiCustomTabControl1.Enabled = true;
                Narc[0] = new AndiNarcReader();
                Narc[0].OpenData(path);
                EventsAfterOpenFile();
            }
        }
コード例 #2
0
ファイル: AndiFileDialog.cs プロジェクト: javierhimura/ANDT
        public static void NarcSaveDialog(AndiNarcReader narc, string lstpath, string title, string filter)
        {
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.Title            = title;
            dialog.Filter           = filter;
            dialog.InitialDirectory = lstpath;

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                narc.SaveData(dialog.FileName);
            }
        }