/// <summary> /// TODO /// </summary> /// <param name="dict"></param> /// <returns></returns> private String ConvertDictToString(IOrderedEnumerable <KeyValuePair <Int32, ChangeByteRecord> > dict) { StringBuilder sb = new StringBuilder(); foreach (KeyValuePair <Int32, ChangeByteRecord> kvp in dict) { ChangeByteRecord b = kvp.Value; sb.Append($"0x{b.Address:X6}\t{b.Value:X2}\t{b.Note}"); sb.Append(Environment.NewLine); } return(sb.ToString()); }
public void Add(int address, byte value, string note = "") { ChangeByteRecord newByte = new ChangeByteRecord(address, value, note); // Either replace the byte at the given address, or add it if it doesn't exist if (Bytes.ContainsKey(address)) { Bytes[address] = newByte; } else { Bytes.Add(address, newByte); } }
private string ConvertDictToString(IOrderedEnumerable <KeyValuePair <int, ChangeByteRecord> > dict) { StringBuilder sb = new StringBuilder(); foreach (KeyValuePair <int, ChangeByteRecord> kvp in dict) { ChangeByteRecord b = kvp.Value; sb.Append(String.Format( "0x{0:X6}\t{1:X2}\t{2}", b.Address, b.Value, b.Note)); sb.Append(Environment.NewLine); } return(sb.ToString()); }