Beispiel #1
0
        public virtual HostExecutionContext Capture()
        {
            HostExecutionContext executionContext = (HostExecutionContext)null;

            if (HostExecutionContextManager.CheckIfHosted())
            {
                IUnknownSafeHandle iunknownSafeHandle = new IUnknownSafeHandle();
                executionContext = new HostExecutionContext((object)iunknownSafeHandle);
                HostExecutionContextManager.CaptureHostSecurityContext((SafeHandle)iunknownSafeHandle);
            }
            return(executionContext);
        }
        public virtual HostExecutionContext Capture()
        {
            HostExecutionContext result = null;

            if (HostExecutionContextManager.CheckIfHosted())
            {
                IUnknownSafeHandle unknownSafeHandle = new IUnknownSafeHandle();
                result = new HostExecutionContext(unknownSafeHandle);
                HostExecutionContextManager.CaptureHostSecurityContext(unknownSafeHandle);
            }
            return(result);
        }