Capture() публичный статический Метод

public static Capture ( ) : SecurityContext
Результат SecurityContext
Пример #1
0
        public static SecurityContext Capture()
        {
            if (SecurityContext.IsFlowSuppressed())
            {
                return((SecurityContext)null);
            }
            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;

            return(SecurityContext.Capture(Thread.CurrentThread.GetExecutionContextReader(), ref stackMark) ?? SecurityContext.CreateFullTrustSecurityContext());
        }
Пример #2
0
        [MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
        public static SecurityContext Capture( )
        {
            // check to see if Flow is suppressed
            if (IsFlowSuppressed())
            {
                return(null);
            }

            StackCrawlMark  stackMark = StackCrawlMark.LookForMyCaller;
            SecurityContext sc        = SecurityContext.Capture(Thread.CurrentThread.GetExecutionContextReader(), ref stackMark);

            if (sc == null)
            {
                sc = CreateFullTrustSecurityContext();
            }
            return(sc);
        }