Exemplo n.º 1
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         DevFile = new DeviceFile();
         if (DevFile.LoadFromFile(openFileDialog1.FileName))
         {
             DeviceFileLoaded();
         }
     }
 }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DevFile = new DeviceFile();

            bool result = false;
            result = DevFile.LoadFromFile("PK2DeviceFile.dat");

            /*
            if (!result) result = DevFile.LoadFromFile("C:\\Program Files\\Microchip\\PICkit 2\\PK2DeviceFile.dat");
            if (!result) result = DevFile.LoadFromFile("C:\\Program Files\\Microchip\\PICkit 2 v2\\PK2DeviceFile.dat");
            if (!result) result = DevFile.LoadFromFile("C:\\Program Files (x86)\\Microchip\\PICkit 2\\PK2DeviceFile.dat");
            if (!result) result = DevFile.LoadFromFile("C:\\Program Files (x86)\\Microchip\\PICkit 2 v2\\PK2DeviceFile.dat");
            */

            if (!result)
            {
                if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {

                    result = DevFile.LoadFromFile(openFileDialog1.FileName);
                }
            }

            if (result) DeviceFileLoaded();
        }