Exemple #1
0
        private void InitTblMappings()
        {
            DebugWorkspace workspace = DebugWorkspaceManager.GetWorkspace();

            if (workspace.TblMappings != null && workspace.TblMappings.Count > 0)
            {
                var tblDict = TblLoader.ToDictionary(workspace.TblMappings.ToArray());
                if (tblDict != null)
                {
                    this.ctrlHexViewer.ByteCharConverter = new TblByteCharConverter(tblDict);
                }
            }
            else
            {
                this.ctrlHexViewer.ByteCharConverter = null;
            }
        }
Exemple #2
0
        private void mnuLoadTblFile_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.SetFilter("TBL files (*.tbl)|*.tbl");
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                string[] fileContents = File.ReadAllLines(ofd.FileName);
                var      tblDict      = TblLoader.ToDictionary(fileContents);
                if (tblDict == null)
                {
                    MessageBox.Show("Could not load TBL file.  The file selected file appears to be invalid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    DebugWorkspaceManager.GetWorkspace().TblMappings = new List <string>(fileContents);
                    this.ctrlHexViewer.ByteCharConverter = new TblByteCharConverter(tblDict);
                    this.mnuShowCharacters.Checked       = true;
                }
            }
        }