public SConfig[] ToSConfigArray() { SConfig[] result = new SConfig[Length]; for (int i = 0; i < result.Length; i++) { result[i] = getIndex(i); } return(result); }
public HeapSConfigArray(SConfig ConfigItem) { //Create a blob big enough for 'ConfigItems' and two longs (NumOfItems and pItems) Ptr = Marshal.AllocHGlobal(16); arrayPtr = IntPtr.Add(Ptr, 8); Length = 1; //Set Number of items //Write pItems. To save complexity, the array immediately follows SConfigArray. Marshal.WriteIntPtr(Ptr, 4, IntPtr.Add(Ptr, 8)); //Write ConfigItem to the blob Marshal.StructureToPtr <SConfig>(ConfigItem, arrayPtr, false); }
private void setIndex(int Index, SConfig SConfig) { Marshal.StructureToPtr <SConfig>(SConfig, IntPtr.Add(arrayPtr, Index * 8), false); }