public void InitList(ListBox listBox, MemorySharp sharp) { for (uint i = 0; i < COUNT; ++i) { IntPtr mem = new IntPtr(ADDRESS + i * SIZE); T thing = (T)Activator.CreateInstance(typeof(T), new object[] { sharp[sharp.MakeRelative(mem)], i }); items.Add(i, thing); listBox.Items.Add(thing); } }