ZeroInstall.OneGet.OneGetContextInterceptor.Intercept C# (CSharp) Method

Intercept() public method

public Intercept ( LinFu.DynamicProxy.InvocationInfo info ) : object
info LinFu.DynamicProxy.InvocationInfo
return object
        public object Intercept(InvocationInfo info)
        {
            #region Sanity checks
            if (info == null) throw new ArgumentNullException(nameof(info));
            #endregion

            // Double-checked locking
            if (_context == null)
            {
                lock (_initLock)
                {
                    if (_context == null)
                        _context = InitExternalContext();
                }
            }

            _request.Debug("Forwarding to other Zero Install instance: {0}", info.TargetMethod.Name);
            return DuckType(_context, info);
        }