internal static DnsRequestProcessedEventArgs FromNativeObject( AGDnsApi.ag_dns_request_processed_event coreArgsС) { List <string> rules = MarshalUtils.AgListToList <IntPtr, string>( coreArgsС.rules, MarshalUtils.PtrToString); List <int> filterListIds = MarshalUtils.AgListToList <IntPtr, int>( coreArgsС.filter_list_ids, filterId => (int)filterId); int?upstreamId = MarshalUtils.PtrToNullableInt(coreArgsС.pUpstreamId); DnsRequestProcessedEventArgs eventArgs = new DnsRequestProcessedEventArgs { UpstreamId = upstreamId, Rules = rules, FilterListIds = filterListIds }; MarshalUtils.AllPtrsToStrings(coreArgsС, eventArgs); MarshalUtils.CopyFieldsToProperties(coreArgsС, eventArgs); return(eventArgs); }