Beispiel #1
0
        private void LoadCustomFirmware(object sender, RoutedEventArgs e)
        {
            #if DEBUG
            string curDir   = Directory.GetCurrentDirectory();
            string baseDir  = Directory.GetParent(Directory.GetParent(curDir).FullName).FullName;
            string filePath = string.Empty;

            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = "c:\\";
            openFileDialog.Filter           = "bin files (*.bin)|*.bin|All files (*.*)|*.*";

            bool?result = openFileDialog.ShowDialog();

            // Process open file dialog box results
            if (result == true)
            {
                // Open document
                string bin_filename = openFileDialog.FileName;
                System.Diagnostics.Process.Start(curDir + "\\FirmwareInstall.bat", HID_Connection.DefaultVIDString() + " " + HID_Connection.DefaultUninstalledPIDString() + " \"" + bin_filename + "\"");
            }
            #else
            #endif
        }
Beispiel #2
0
 private void LoadDefaultFirmware(object sender, RoutedEventArgs e)
 {
     #if DEBUG
     string curDir  = Directory.GetCurrentDirectory();
     string baseDir = Directory.GetParent(Directory.GetParent(curDir).FullName).FullName;
     try
     {
         System.Diagnostics.Process.Start(curDir + "\\FirmwareInstall.bat", HID_Connection.DefaultVIDString() + " " + HID_Connection.DefaultUninstalledPIDString() + " \"" + curDir + curFirmwareName + "\"");
     }
     catch
     {
     }
     #else
     #endif
 }