public bool ProgramAll() { int hr; //-1-. Initialize programmer Log.PrintLog(this, "Initializing programmer.", LogDetailLevel.LogRelevant); if (!InitializeProgrammer()) { return(false); } //-2-. Program if (ValidateAfterProgramming) { Log.PrintLog(this, "Programming and verifying...", LogDetailLevel.LogRelevant); } else { Log.PrintLog(this, "Programming...", LogDetailLevel.LogRelevant); } hr = Programmer.lib_Program(); if (!IsSuccess(hr)) { string errString = Programmer.lib_GetLastError(); Log.PrintLog(this, errString, LogDetailLevel.LogRelevant); return(false); } // Read checksum from hex file to print in the log string m_sLastError; short hexChecksum; hr = Programmer.HEX_ReadChecksum(out hexChecksum, out m_sLastError); if (!IsSuccess(hr)) { Log.PrintLog(this, m_sLastError, LogDetailLevel.LogRelevant); return(false); } Log.PrintLog(this, "Checksum 0x" + hexChecksum.ToString("X"), LogDetailLevel.LogRelevant); return(true); }