internal History(FFIHistory history) { TransactionType = history.transaction_type; BoardingDateTime = DateTimeOffset.FromUnixTimeSeconds(history.boarding_datetime); TransferEndDateTime = DateTimeOffset.FromUnixTimeSeconds(history.transfer_end_datetime); TicketFareCents = history.ticket_fare_cents; GroupSize = history.group_size; RemainingValue = history.remaining_value; }
internal FFIHistory[] AsFFIHistoryArray() { int historyStructSize = Marshal.SizeOf(typeof(FFIHistory)); uint length = Len.ToUInt32(); FFIHistory[] ffiHistories = new FFIHistory[length]; for (int i = 0; i < length; i++) { IntPtr structData = new IntPtr(Data.ToInt64() + historyStructSize * i); ffiHistories[i] = Marshal.PtrToStructure <FFIHistory>(structData); } return(ffiHistories); }