public WriteLogbookEntry ( LogbookEntryType type, string logbookEntry ) : void | ||
type | LogbookEntryType | |
logbookEntry | string | |
리턴 | void |
public void savedatatobinary(int address, int length, byte[] data, string filename, bool DoTransActionEntry, string note, EDCFileType type) { // depends on filetype (EDC16 is not reversed) if (type != EDCFileType.EDC16) { data = reverseEndian(data); } if (address > 0 && address < m_currentfilelength) { try { byte[] beforedata = readdatafromfile(filename, address, length, type); FileStream fsi1 = File.OpenWrite(filename); BinaryWriter bw1 = new BinaryWriter(fsi1); fsi1.Position = address; for (int i = 0; i < length; i++) { bw1.Write((byte)data.GetValue(i)); } fsi1.Flush(); bw1.Close(); fsi1.Close(); fsi1.Dispose(); if (m_ProjectTransactionLog != null && DoTransActionEntry) { // depends on filetype (EDC16 is not reversed) if (type != EDCFileType.EDC16) { data = reverseEndian(data); } TransactionEntry tentry = new TransactionEntry(DateTime.Now, address, length, beforedata, data, 0, 0, note); m_ProjectTransactionLog.AddToTransactionLog(tentry); if (m_CurrentWorkingProject != string.Empty) { m_ProjectLog.WriteLogbookEntry(LogbookEntryType.TransactionExecuted, GetSymbolNameByAddress(address) + " " + note); } } } catch (Exception E) { frmInfoBox info = new frmInfoBox("Failed to write to binary. Is it read-only? Details: " + E.Message); } } }