示例#1
0
        private void pDBFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            if (sfd.ShowDialog() == DialogResult.OK && !String.IsNullOrEmpty(sfd.FileName))
            {
                DialogResult result = MessageBox.Show("Do you want to load initial database values?", "Load Initial Values?",
                                                      MessageBoxButtons.YesNo);

                pnlContent.Controls.Clear();
                File.WriteAllBytes(sfd.FileName, new byte[4]);
                DataBaseEditor editor = new DataBaseEditor(new X360IO(sfd.FileName, FileMode.OpenOrCreate, true));
                pnlContent.Controls.Add(editor);
                if (result == DialogResult.Yes)
                {
                    editor.DataBase.LoadInitialValues();
                    editor.LoadEntries();
                }
            }
        }
示例#2
0
        public void OpenFile(string fileName)
        {
            Text = ver + " - " + fileName;
            X360IO io    = new X360IO(fileName, FileMode.Open, true);
            uint   magic = io.Reader.ReadUInt32();

            pnlContent.Controls.Clear();
            switch (magic)
            {
            case 0x00000000:
                // PDB?
                DataBaseEditor editor = new DataBaseEditor(io);
                pnlContent.Controls.Add(editor);
                break;

            case 0x53434555:
                // PUP file
                PUPFile file = new PUPFile(io);    // {AutoSize = true, BackColor = Color.Transparent};
                pnlContent.Controls.Add(file);
                break;

            case 0x53434500:
                // SCE header
                SCEEditor form1 = new SCEEditor(io);    // {AutoSize = true, BackColor = Color.Transparent};
                pnlContent.Controls.Add(form1);
                break;

            case 0xBCADADBC:
                // registry file
                RegistryEditor form = new RegistryEditor(io);    // { AutoSize = true, BackColor = Color.Transparent };
                pnlContent.Controls.Add(form);
                break;

            default:
                // unknown
                MessageBox.Show("Unknown file!");
                io.Close();
                Text = ver;
                break;
            }
        }
示例#3
0
        private void pDBFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();
            if(sfd.ShowDialog() == DialogResult.OK && !String.IsNullOrEmpty(sfd.FileName))
            {
                DialogResult result = MessageBox.Show("Do you want to load initial database values?", "Load Initial Values?",
                                                  MessageBoxButtons.YesNo);

                pnlContent.Controls.Clear();
                File.WriteAllBytes(sfd.FileName, new byte[4]);
                DataBaseEditor editor = new DataBaseEditor(new X360IO(sfd.FileName, FileMode.OpenOrCreate, true));
                pnlContent.Controls.Add(editor);
                if (result == DialogResult.Yes)
                {
                    editor.DataBase.LoadInitialValues();
                    editor.LoadEntries();
                }
            }
        }
示例#4
0
 public void OpenFile(string fileName)
 {
     Text = ver + " - " + fileName;
     X360IO io = new X360IO(fileName, FileMode.Open, true);
     uint magic = io.Reader.ReadUInt32();
     pnlContent.Controls.Clear();
     switch(magic)
     {
         case 0x00000000:
             // PDB?
             DataBaseEditor editor = new DataBaseEditor(io);
             pnlContent.Controls.Add(editor);
             break;
         case 0x53434555:
             // PUP file
             PUPFile file = new PUPFile(io);// {AutoSize = true, BackColor = Color.Transparent};
             pnlContent.Controls.Add(file);
             break;
         case 0x53434500:
             // SCE header
             SCEEditor form1 = new SCEEditor(io);// {AutoSize = true, BackColor = Color.Transparent};
             pnlContent.Controls.Add(form1);
             break;
         case 0xBCADADBC:
             // registry file
             RegistryEditor form = new RegistryEditor(io);// { AutoSize = true, BackColor = Color.Transparent };
             pnlContent.Controls.Add(form);
             break;
         default:
             // unknown
             MessageBox.Show("Unknown file!");
             io.Close();
             Text = ver;
             break;
     }
 }