Пример #1
0
        private static OutboundProxyAuthInfo FromNativeObject(
            AGDnsApi.ag_outbound_proxy_auth_info outboundProxyAuthInfoC)
        {
            OutboundProxyAuthInfo outboundProxyAuthInfo = new OutboundProxyAuthInfo();

            MarshalUtils.CopyFieldsToProperties(outboundProxyAuthInfoC, outboundProxyAuthInfo);
            MarshalUtils.AllPtrsToStrings(outboundProxyAuthInfoC, outboundProxyAuthInfo);
            return(outboundProxyAuthInfo);
        }
Пример #2
0
 private static AGDnsApi.ag_outbound_proxy_auth_info ToNativeObject(
     OutboundProxyAuthInfo outboundProxyAuthInfo,
     Queue <IntPtr> allocatedPointers)
 {
     AGDnsApi.ag_outbound_proxy_auth_info outboundProxyAuthInfoC =
         new AGDnsApi.ag_outbound_proxy_auth_info();
     MarshalUtils.CopyPropertiesToFields(outboundProxyAuthInfo, ref outboundProxyAuthInfoC);
     MarshalUtils.AllStringsToPtrs(
         outboundProxyAuthInfo,
         ref outboundProxyAuthInfoC,
         allocatedPointers);
     return(outboundProxyAuthInfoC);
 }
Пример #3
0
        private static OutboundProxySettings FromNativeObject(
            AGDnsApi.ag_outbound_proxy_settings outboundProxySettingsC)
        {
            AGDnsApi.ag_outbound_proxy_auth_info outboundProxyAuthInfoC =
                MarshalUtils.PtrToStructure <AGDnsApi.ag_outbound_proxy_auth_info>(
                    outboundProxySettingsC.auth_info);

            OutboundProxyAuthInfo authInfo = FromNativeObject(outboundProxyAuthInfoC);
            OutboundProxySettings outboundProxySettings = new OutboundProxySettings
            {
                AuthInfo = authInfo
            };

            MarshalUtils.CopyFieldsToProperties(outboundProxySettingsC, outboundProxySettings);
            MarshalUtils.AllPtrsToStrings(outboundProxySettingsC, outboundProxySettings);
            return(outboundProxySettings);
        }