예제 #1
0
        private void AppendMenuItem_Click(object sender, EventArgs e)
        {
            if (_cdl == null)
            {
                MessageBox.Show(this, "Cannot append with no CDL loaded!", "Alert");
            }
            else
            {
                var file = ToolHelpers.OpenFileDialog(
                    _currentFilename,
                    PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
                    "Code Data Logger Files",
                    "cdl");

                if (file != null)
                {
                    using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
                    {
                        var newCDL = new CodeDataLog();
                        newCDL.Load(fs);
                        if (!_cdl.Check(newCDL))
                        {
                            MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
                            return;
                        }
                        _cdl.LogicalOrFrom(newCDL);
                        UpdateDisplay(true);
                    }
                }
            }
        }
예제 #2
0
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var file = ToolHelpers.OpenFileDialog(
                _currentFilename,
                PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
                "Code Data Logger Files",
                "cdl");

            if (file == null)
            {
                return;
            }

            //take care not to clobber an existing CDL
            if (_cdl != null)
            {
                var result = MessageBox.Show(this, "OK to load new CDL?", "Query", MessageBoxButtons.YesNo);
                if (result != DialogResult.Yes)
                {
                    return;
                }
            }

            LoadFile(file.FullName);
        }
예제 #3
0
파일: Cheats.cs 프로젝트: budzikt/BizHawk
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var append = sender == AppendMenuItem;
            var file   = ToolHelpers.OpenFileDialog(
                Global.CheatList.CurrentFileName,
                PathManager.GetCheatsPath(Global.Game),
                "Cheat Files",
                "cht");

            LoadFile(file, append);
        }
예제 #4
0
파일: BasicBot.cs 프로젝트: budzikt/BizHawk
        private void OpenMenuItem_Click(object sender, EventArgs e)
        {
            var file = ToolHelpers.OpenFileDialog(
                CurrentFileName,
                PathManager.GetRomsPath(Global.Game.System),                         // TODO: bot path
                "Bot files",
                "bot"
                );

            if (file != null)
            {
                LoadBotFile(file.FullName);
            }
        }
예제 #5
0
        private void OpenTasMenuItem_Click(object sender, EventArgs e)
        {
            if (AskSaveChanges())
            {
                var filename = CurrentTasMovie.Filename;
                if (string.IsNullOrWhiteSpace(filename) || filename == DefaultTasProjName())
                {
                    filename = string.Empty;
                }

                var file = ToolHelpers.OpenFileDialog(
                    filename,
                    PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null),
                    "Tas Project Files",
                    "tasproj");

                if (file != null)
                {
                    LoadFile(file);
                }
            }
        }