internal TravelCard(FFITravelCard travelCard) { ActionListCounter = travelCard.action_list_counter; ApplicationInstanceId = new RustString(travelCard.application_instance_id).ToString(); ApplicationIssuingDate = DateTimeOffset.FromUnixTimeSeconds(travelCard.application_issuing_date); ApplicationKeyVersion = travelCard.application_key_version; ApplicationStatus = travelCard.application_status != 0; ApplicationTransactionCounter = travelCard.application_transaction_counter; ApplicationUnblockingNumber = travelCard.application_unblocking_number; ApplicationVersion = travelCard.application_version; ETicket = new ETicket(travelCard.e_ticket); History = travelCard.history.AsFFIHistoryArray().Select(x => new History(x)).ToArray(); IsMacProtected = travelCard.is_mac_protected != 0; LastLoadDateTime = DateTimeOffset.FromUnixTimeSeconds(travelCard.last_load_datetime); LastLoadDeviceNum = travelCard.last_load_device_num; LastLoadOrganization = travelCard.last_load_organization_id; LastLoadValue = travelCard.last_load_value; PeriodPass = new PeriodPass(travelCard.period_pass); PlatformType = travelCard.platform_type; StoredValueCents = travelCard.stored_value_cents; }
private TravelCard ReadStructData() { FFITravelCard travelCard = Marshal.PtrToStructure <FFITravelCard>(handle); return(new TravelCard(travelCard)); }