Setup() 개인적인 메소드

private Setup ( ) : void
리턴 void
 public static AsyncFlowControl SuppressFlow()
 {
     if (IsFlowSuppressed())
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotSupressFlowMultipleTimes"));
     }
     AsyncFlowControl afc = new AsyncFlowControl();
     afc.Setup();
     return afc;
 }
예제 #2
0
        internal static AsyncFlowControl SuppressFlow(SecurityContextDisableFlow flags)
        {
#if MOBILE
            throw new NotSupportedException ();
#else
            if (IsFlowSuppressed(flags))
            {
                throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotSupressFlowMultipleTimes"));
            }

            ExecutionContext ec = Thread.CurrentThread.GetMutableExecutionContext();
            if (ec.SecurityContext == null)
                ec.SecurityContext = new SecurityContext();
            AsyncFlowControl afc = new AsyncFlowControl();
            afc.Setup(flags);
            return afc;
#endif
        }
예제 #3
0
        internal static AsyncFlowControl SuppressFlow(SecurityContextDisableFlow flags)
        { 
            if (IsFlowSuppressed(flags)) 
            {
                throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotSupressFlowMultipleTimes")); 
            }

            if (Thread.CurrentThread.ExecutionContext.SecurityContext == null)
                Thread.CurrentThread.ExecutionContext.SecurityContext = new SecurityContext(); 
            AsyncFlowControl afc = new AsyncFlowControl();
            afc.Setup(flags); 
            return afc; 
        }