Example #1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog fd = new OpenFileDialog();

            fd.Title            = "Open";
            fd.InitialDirectory = XSCLocation;
            fd.Filter           = "Xenon Script Container|*.xsc";
            fd.FilterIndex      = 1;
            fd.RestoreDirectory = true;
            if (fd.ShowDialog() == DialogResult.OK)
            {
                //FileLocation.Text = fd.FileName;
                XSCLocation = fd.FileName;
                //string convertedAssembly;
                xscToOpen = new XSC(XSCLocation);
                paramCountTextBox.Text = xscToOpen.GetParameterCount().ToString();
                //string table
                stringTable.Enabled    = true;
                stringTable.DataSource = xscToOpen.GetStringTable();
                //natives table
                nativesTable.Enabled    = true;
                nativesTable.DataSource = xscToOpen.GetNativesTable();
                //assembly
                assemblyTextEditor.Text = xscToOpen.GetASM();
                //XSC name
                XSCNameTextBox.Text = xscToOpen.GetXSCName();
                staticVariables.Items.Clear();
                List <int> statics = xscToOpen.GetStaticVariablesTable();
                for (int i = 0; i < statics.Count; i++)
                {
                    staticVariables.Items.Add(statics[i]);
                }
                //staticVariables.DataSource = xscToOpen.GetStaticVariablesTable();
                varCounter.Text = "(" + staticVariables.Items.Count + ")";
            }
        }