예제 #1
0
        private void frm_main_DragDrop(object sender, DragEventArgs e)
        {
            string[] droppedFiles = ((string[])e.Data.GetData(DataFormats.FileDrop));
            string   droppedFile  = droppedFiles[0];

            switch (VariousFunctions.ReadFileType(droppedFile))
            {
            case XboxFileType.Music: break;

            case XboxFileType.STFS: {
                if (droppedFiles.Count() > 1)
                {
                    List <string> Accepted = new List <string>();
                    for (int i = 0; i < droppedFiles.Count(); i++)
                    {
                        if (VariousFunctions.ReadFileType(droppedFiles[i]) == XboxFileType.STFS)
                        {
                            Accepted.Add(droppedFiles[i]);
                        }
                    }

                    if (Accepted.ToArray().Count() > 1)
                    {
                        frm_game_info_multiple gim = new frm_game_info_multiple(Accepted.ToArray());
                        gim.MdiParent = this;
                        gim.Show();
                    }
                    else if (Accepted.ToArray().Count() == 1)
                    {
                        frm_game_info gi = new frm_game_info(Accepted.ToArray()[0]);
                        gi.MdiParent = this;
                        gi.Show();
                    }
                }
                else if (droppedFiles.Count() == 1)
                {
                    frm_game_info gi = new frm_game_info(droppedFile);
                    gi.MdiParent = this;
                    gi.Show();
                }
                break;
            }

            case XboxFileType.SVOD: break;

            case XboxFileType.FATX: break;

            case XboxFileType.GPD: break;

            case XboxFileType.GDF: break;

            default: MessageBox.Show("Unknown file type!"); break;
            }
        }
예제 #2
0
        private void tsmi_game_info_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Game Info has the ability to send/view 1 or more update files or profile files. If you'd like to open more than one, be sure you have all of the ones you'd like to choose in one folder.", "Game Info - Info", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
            {
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.Title       = "Find STFS File";
                ofd.Filter      = "All Files *.*|*.*";
                ofd.Multiselect = true;
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    List <string> AcceptedFiles = new List <string>();

                    for (int i = 0; i < ofd.FileNames.Count(); i++)
                    {
                        if (VariousFunctions.ReadFileType(ofd.FileNames[i]) == XboxFileType.STFS)
                        {
                            AcceptedFiles.Add(ofd.FileNames[i]);
                        }
                    }

                    if (AcceptedFiles.Count > 1)
                    {
                        frm_game_info_multiple gim = new frm_game_info_multiple(AcceptedFiles.ToArray());
                        gim.MdiParent = this;
                        gim.Show();
                    }
                    else if (AcceptedFiles.Count == 1)
                    {
                        frm_game_info gi = new frm_game_info(AcceptedFiles.ToArray()[0]);
                        gi.MdiParent = this;
                        gi.Show();
                    }
                    else
                    {
                        MessageBox.Show("No files were accepted!\n\nPlease ensure you have accepted STFS files!", "Oh noes!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }