AddImage() публичный Метод

public AddImage ( ECU d ) : void
d SharpTuneCore.ECU
Результат void
Пример #1
0
        public void openDeviceImage(string filename)
        {
            //Construct new romimage
            //TODO move this, application logic shouldn't be in GUI class.
            ECU newImage = new ECU(sharpTuner, filename);

            if (newImage.CalId == null)
            {
                Trace.TraceWarning(String.Format("Unable to identify rom at {0}", newImage.FilePath.ToString()));
                MessageBox.Show("Unable to idenfity rom at " + newImage.FilePath.ToString());
                return;
            }
            foreach (ECU image in sharpTuner.ImageList)
            {
                if (image.FilePath == filename)
                {
                    Console.Write("Rom is already open!");
                    return;
                }
            }
            this.closeDeviceImageToolStripMenuItem.Enabled = true;
            obfuscateCALIDToolStripMenuItem.Enabled        = true;
            sharpTuner.AddImage(newImage);
            this.openDeviceListBox.Items.Add(sharpTuner.activeImage.FileName);
            Trace.WriteLine("Successfully opened " + sharpTuner.activeImage.CalId + " filename: " + sharpTuner.activeImage.FileName);
            Refresh();
        }
Пример #2
0
        public void openDeviceImage(string filename)
        {
            //Construct new romimage
            DeviceImage newImage = new DeviceImage(filename);

            if (newImage.CalId == null)
            {
                Trace.TraceWarning(String.Format("Unable to identify rom at {0}", newImage.FilePath.ToString()));
                MessageBox.Show("Unable to idenfity rom at " + newImage.FilePath.ToString());
                return;
            }
            foreach (DeviceImage image in SharpTuner.ImageList)
            {
                if (image.FilePath == filename)
                {
                    Console.Write("Rom is already open!");
                    return;
                }
            }
            this.closeDeviceImageToolStripMenuItem.Enabled = true;
            obfuscateCALIDToolStripMenuItem.Enabled        = true;
            SharpTuner.AddImage(newImage);
            this.openDeviceListBox.Items.Add(SharpTuner.ActiveImage.FileName);
            Trace.WriteLine("Successfully opened " + SharpTuner.ActiveImage.CalId + " filename: " + SharpTuner.ActiveImage.FileName);
            Refresh();
        }