public void Setup(Int32 memoryAddress, EPS.Components.MemoryBank memory = null) // Final stage of setup. { string memoryAddressString = Convert.ToString(memoryAddress, 2).PadLeft(3, '0'); // String format val lblAddress.Text = "Address " + memoryAddressString.Substring(memoryAddressString.Length - 3); // Ensure length is correct _memory = memory ?? _memory; // Handle memory being null. _memoryAddress = memoryAddress; UpdateCell(); }
public void Setup(Int32 memoryStart, EPS.Components.MemoryBank memory = null) { lblAddressStart.Text = Convert.ToString(memoryStart, 2).PadLeft(16, '0'); // String formatting for binary style to 16 bits. lblAddressEnd.Text = Convert.ToString(memoryStart + 7, 2).PadLeft(16, '0'); for (int i = 0; i < 8; i++) { _cells[i].Setup(memoryStart + i, memory); // Propogate setup to cells.a } }