public void AddDevice(ADevice device, ushort index)
{
if (index == 0 || index > 16)
return;
if (m_Devices[index - 1] != null) {
m_Devices[index - 1].Dispose();
m_Devices[index - 1] = null;
}
m_Devices[index - 1] = device;
foreach (Segment segment in m_References) {
if (((segment.Reference & MemoryReferenceInfo.ReferenceType) == MemoryReferenceInfo.Device) &&
((segment.Reference & MemoryReferenceInfo.DeviceIndex) == (MemoryReferenceInfo)index)) {
GetDeviceMemoryReference(segment, index);
}
}
}