示例#1
0
 public SConfig[] ToSConfigArray()
 {
     SConfig[] result = new SConfig[Length];
     for (int i = 0; i < result.Length; i++)
     {
         result[i] = getIndex(i);
     }
     return(result);
 }
示例#2
0
        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);
        }
示例#3
0
 private void setIndex(int Index, SConfig SConfig)
 {
     Marshal.StructureToPtr <SConfig>(SConfig, IntPtr.Add(arrayPtr, Index * 8), false);
 }